DataViewBase.CellDisplayTemplate Property
Gets or sets a template that displays column values. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
#Declaration
public DataTemplate CellDisplayTemplate { get; set; }
#Property Value
Type | Description |
---|---|
Data |
A template that displays column values. |
#Remarks
The binding source for the CellDisplayTemplate template is represented by the EditGridCellData class.
In-place editors are used for both presenting data and editing records. You can use separate in-place editors for both tasks. Each column provides two templates that allow you to define custom editors that display (when the grid is in browse mode) and/or edit (when the grid is in edit mode) column values:
Template | Description |
---|---|
Column |
Defines a template that displays column values. |
Column |
Defines a template that represents an editor used to edit cell values. |
In the following code sample, a numeric column uses the ProgressBarEdit editors to display data. When users focus cells, the TrackBarEdit editors replace progress bars:
<dxg:GridControl>
<!-- ... -->
<dxg:GridColumn FieldName="UnitsOnOrder">
<dxg:GridColumn.CellDisplayTemplate>
<DataTemplate>
<dxe:ProgressBarEdit Name="PART_Editor" Minimum="0" Maximum="50" />
</DataTemplate>
</dxg:GridColumn.CellDisplayTemplate>
<dxg:GridColumn.CellEditTemplate>
<DataTemplate>
<dxe:TrackBarEdit Name="PART_Editor" Minimum="0" Maximum="50" />
</DataTemplate>
</dxg:GridColumn.CellEditTemplate>
</dxg:GridColumn>
<!-- ... -->
</dxg:GridControl>
Tip
- For the DevExpress Data Editors (the Base
Edit class’s descendants), you can set the editor’s Name property to PART_Editor. In this case, the GridControl automatically adjusts its appearance and synchronizes the editor with the source field specified by the ColumnBase. or ColumnField Name Base. properties.Binding - Use the editor’s Edit
Value property if you need to bind it in a custom way and set the editor’s Name property to PART_Editor. In this case, the GridControl ‘s logic of getting/setting the editor’s value is disabled. - You can specify the following validation binding properties: Validates
On , ValidatesData Errors On , NotifyExceptions On , and NotifyValidation Error On .Source Updated
Tip
A template that defines the presentation of data cells is specified by the Cell
If both the Cell