The binding source for the CellEditTemplate template is represented by the GridCellData 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:
In the following code sample, a numeric column uses the ProgressBarEdit editors to display data. When end users focus cells, the TrackBarEdit editors replace progress bars:

Xaml |
<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 BaseEdit (see BaseEdit) 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 FieldName or Binding properties.
- You can use any binding with an editor named 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: System.Windows.Data.Binding.ValidatesOnDataErrors, System.Windows.Data.Binding.ValidatesOnExceptions, System.Windows.Data.Binding.NotifyOnValidationError, and System.Windows.Data.Binding.NotifyOnSourceUpdated.
Tip
A template that defines the presentation of data cells is specified by the CellEditTemplate property. If you have more than one template that can be used to render cells, you can implement custom logic to choose the required template. To do this, derive from the System.Windows.Controls.DataTemplateSelector class, implement the SelectTemplate method that returns a template which meets the required condition, and assign it to the CellEditTemplateSelector property.
If both the CellDisplayTemplate and CellEditTemplateSelector are specified, a cell is rendered using the template returned by the template selector. If the template selector returns null, the template specified by the CellEditTemplate property is used.