Data Editing and Validation
- 2 minutes to read
Edit Cell Values
The Edit Cell Values in UI section describes end-user data editing capabilities. It also explains how you can customize these features. For a list of API methods, refer to the following help topic: Obtain and Set Cell Values in Code.
The Add and Remove Rows topic explains how to add/remove data records in the UI or in code.
The Clipboard Management topic describes how to perform copy and paste operations in the UI or in code.
- How to: Prevent Individual Cells From Being Edited
- How to: Assign a ComboBox Editor to a Column
- How to: Use Custom Editors to Edit Cell Values
- How to: Specify Navigation in Custom Cell Editors
The GridControl raises special events that allow you to validate modified cells and rows:
A basic way to implement data validation is to use masks. Masks restrict data input and format data output.
Use a column’s EditSettings property to specify a mask.
<dxg:GridColumn FieldName="Name" > <dxg:GridColumn.EditSettings> <dxe:TextEditSettings Mask="C" MaskType="Numeric" /> </dxg:GridColumn.EditSettings> </dxg:GridColumn>
Alternatively, you can specify a CellTemplate.
<dxg:GridColumn FieldName="Id" > <dxg:GridColumn.CellTemplate> <DataTemplate> <dxe:TextEdit x:Name="PART_Editor" Mask="C" MaskType="Numeric"/> </DataTemplate> </dxg:GridColumn.CellTemplate> </dxg:GridColumn>
For more information on masks, refer to the following help topic: Masked Input.
Do not use the editor’s events to validate grid data. Use the grid’s events instead.
You can validate data based on interfaces and attributes: