You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

Data Editing and Validation

  • 2 minutes to read

Data Editing

Edit Cell Values

The In-place Editors 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 view's NavigationStyle property specifies whether users can focus rows and individual cells. When this property is set to Row, users can only edit existing data in the customizable Edit Form.

Inline Edit Form

The Edit Entire Row topic describes how to use the editor to submit or cancel all changes applied to a row. Note that this mode is only available when the NavigationStyle property is set to Cell.

Edit Rows

The Add and Remove Rows topic explains how to add/remove data records in the UI or in code.

Clipboard Operations

The Clipboard Management topic describes how to perform copy and paste operations in the UI or in code.

Examples

Validation

GridControl Level

The GridControl raises special events that allow you to validate modified cells and rows:

Masks

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.

NOTE

Do not use the editor's events to validate grid data. Use the grid's events instead.

Data Level

You can validate data based on interfaces and attributes:

Examples