ASPxVerticalGrid.RecordValidating Event
Enables you to specify whether record data is valid and whether the record can be updated.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
Event Data
The RecordValidating event's data class is ASPxVerticalGridDataValidationEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
EditorPropertiesErrors | Gets a collection of editor errors. |
Errors | Gets a collection of record errors. |
HasErrors | Gets whether the processed data item (row, card or record) has errors. Inherited from ASPxGridDataValidationEventArgs. |
IsNewRecord | Gets whether the processed record is new. |
Keys | Gets a dictionary of field name/value pairs that represent the primary key of the data item (row, card or record) to validate. Inherited from ASPxGridDataValidationEventArgs. |
NewValues | Gets a dictionary that contains the values of the non-key field name/value pairs in the data item (row, card or record) to be validated. Inherited from ASPxGridDataValidationEventArgs. |
OldValues | Gets a dictionary that contains the original field name/value pairs in the data item (row, card or record) to validate. Inherited from ASPxGridDataValidationEventArgs. |
RecordError | Gets or sets the error text displayed within the Record Error. |
VisibleIndex | Gets a visible index of the currently processed data item (row, card or record). Inherited from ASPxGridDataValidationEventArgs. |
Remarks
The RecordValidating event is automatically raised when a record is about to be updated, and allows you to specify whether its data is valid. To manually validate the edited record, call the ASPxGridView.DoRowValidation method.
To obtain the edited record’s values, use the event parameter’s ASPxGridDataValidationEventArgs.NewValues property. The old values are returned by the ASPxGridDataValidationEventArgs.OldValues property. If the value is invalid, use the ASPxDataValidationEventArgs.Errors property to specify the error description text. As a result, an error icon will be displayed next to the invalid value. Pointing to the icon shows the hint with the error description.
Use the ASPxVerticalGridDataValidationEventArgs.RecordError property to specify the error text displayed within the record error. This record is automatically displayed below the record if the RecordError property is set to a non- empty string.