GridControl.ValidateRow Event
Enables you to specify whether the focused row’s data is valid, and whether the row can lose focus.
Namespace: DevExpress.UI.Xaml.Grid
Assembly: DevExpress.UI.Xaml.Grid.v21.2.dll
NuGet Package: DevExpress.Uwp.Controls
Declaration
Event Data
The ValidateRow event's data class is GridRowValidationEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
ErrorContent | Gets or sets an object that describes the validation error. Inherited from ValidationEventArgs. |
ErrorType | Gets or sets the error type. Inherited from ValidationEventArgs. |
IsValid | Gets or sets a value specifying whether the value is valid. Inherited from ValidationEventArgs. |
Row | Gets the processed row. |
RowHandle | Gets the processed row’s handle. |
UpdateSource | Gets the action that caused the validation. Inherited from ValidationEventArgs. |
Value | Gets the editor’s value. Inherited from ValidationEventArgs. |
The event data class exposes the following methods:
Method | Description |
---|---|
SetError(Object, ErrorType) | Displays an error within the editor. Inherited from ValidationEventArgs. |
SetError(Object) | Displays an error within the editor. Inherited from ValidationEventArgs. |
Remarks
Row validation is performed within the ValidateRow event handler. This event is automatically fired after the focused row’s data has been modified and it is about to lose focus. To manually force row validation, call the DataControlBase.CommitEditing method.
The processed row is returned by the event parameter’s GridRowValidationEventArgs.Row property. Its handle is returned by the GridRowValidationEventArgs.RowHandle. After cell values have been obtained, you can verify whether these values meet your validity criteria. If the row fails validation, set the event’s IsValid parameter to false. Otherwise, leave the IsValid parameter set to true.
To learn more, see Row Validation.