Back to Devexpress

Input Validation

wpf-7358-controls-and-libraries-data-grid-data-editing-and-validation-input-validation.md

latest2.9 KB
Original Source

Input Validation

  • Jan 10, 2024
  • 2 minutes to read

You can validate new data before saving it to a data source. Likewise, you can ensure that invalid data is not saved to a data source and related errors are clearly displayed.

Note

When you use a custom CellTemplate, input validation is supported only if the template contains a BaseEdit class descendant that is declared as demonstrated in the following topic: Custom In-Place Cell Editors.

GridControl Level

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

Data Level

You can validate data based on interfaces and attributes:

Check Whether the Grid Contains Validation Errors

The GridControl includes the following properties that allow you to check whether the grid has validation errors:

Examples