Xceed Grid for WinForms v4.3 Documentation
ValidationError Event (Cell)


Xceed.Grid.v4.3 Assembly > Xceed.Grid Namespace > Cell Class : ValidationError Event
Raised when the value of the cell does not pass the validation process.
Syntax
'Declaration
 
<DescriptionAttribute("Raised when the value of the cell does not pass the validation process.")>
<CategoryAttribute("Data")>
Public Event ValidationError As CellValidationErrorEventHandler
'Usage
 
Dim instance As Cell
Dim handler As CellValidationErrorEventHandler
 
AddHandler instance.ValidationError, handler
[Description("Raised when the value of the cell does not pass the validation process.")]
[Category("Data")]
public event CellValidationErrorEventHandler ValidationError
Event Data

The event handler receives an argument of type CellValidationErrorEventArgs containing data related to this event. The following CellValidationErrorEventArgs properties provide information specific to this event.

PropertyDescription
Gets or sets a boolean value indicating if the cell whould exit edit mode.  
Gets the exception that was thrown.  
Gets the value that failed the validation process.  
Remarks

Setting e.CancelEdit to false in the ValidationError event will prevent the cell from leaving edit mode in the case where the its value fails the validation process.

Custom validation can be provided in the LeavingEdit event. In this event, if the validation process fails, setting e.Cancel to true will cause the ValidationError event to be raised.

The cell's ValidationError event will be raised when e.Cancel is set to true in the LeavingEdit event, when an exception is thrown in the LeavingEdit event and/or when a validation exception is thrown by the underlying datasource.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also