In many cases, edit masks and data annotations are not enough to ensure that the data entered by the user is valid. In such cases, you can use EditorValidation property of the Column class. The property consists of validation rules that can be applied to the columns of FlexGrid for enhanced data evaluation.
The GIF below demonstrates StringLength and Required validation rules applied to the Customer column.
The below code example implements the EditorValidation property in the FlexGrid.
A mask won't let you specify a range of possible values, or validate the current cell based on the contents of another cell. In that case, to apply validation to the FlexGrid, you can trap the ValidateEdit event and see if the value contained in the Editor.Text property is a valid entry for the current cell (at this point, the cell still has the original value in it). If the input is invalid, set the Cancel parameter to True and the grid will remain in edit mode until the user types a valid entry.
The code example below validates input into a currency column to ensure that values entered are between 1,000 and 10,000.