GridViewBase.InvalidRowException Event
Fires when a row fails validation or when it cannot be saved to a data source.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v14.2.dll
#Declaration
#Event Data
The InvalidRowException event's handler receives an argument of the InvalidRowExceptionEventArgs type. The following properties provide information specific to this event:
Property | Description |
---|---|
Error |
Gets or sets the error description. |
Exception |
Gets the exception that raised the Grid |
Exception |
Gets or sets a value that specifies how an exception should be handled. |
Handled |
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
Inherited from Routed |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Row |
Gets the processed row.
Inherited from Row |
Row |
Gets the processed row's handle.
Inherited from Row |
Source |
Gets or sets a reference to the object that raised the event.
Inherited from Routed |
Window |
Gets or sets the error window's caption. |
#Remarks
Row validation is performed within the GridViewBase.ValidateRow event handler, when a row is about to lose focus. The InvalidRowException event allows you to override the default error presentation. This event occurs after the GridViewBase.ValidateRow event (provided that the focused row's validation has been failed).
Use the event parameter's InvalidRowExceptionEventArgs.ExceptionMode property to specify the action performed in response to entering an invalid value. You can display a message box with an error description, suppress any action, throw an exception or discard new data and revert to an old value.
To learn more, see Validating Rows.