The event handler receives an argument of type GridRowValidationEventArgs containing data related to this event.
The following
GridRowValidationEventArgs properties provide information specific to this event.
Property |
Description |
ErrorContent |
Gets or sets an object that describes the validation error. |
ErrorType |
Gets or sets the error type. |
Handled |
|
IsValid |
Gets or sets a value specifying whether the value is valid. |
Row |
Gets the processed row. |
RowHandle |
Gets the processed row's handle. |
UpdateSource |
Gets the action that caused the validation. |
Value |
Gets the editor's value. |
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.