Skip to main content

GridControl.ValidateCell Event

Enables you to specify whether the focused cell’s data is valid, and whether the cell’s editor can be closed.

Namespace: DevExpress.WinUI.Grid

Assembly: DevExpress.WinUI.Grid.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

public event EventHandler<GridCellValidationEventArgs> ValidateCell

Event Data

The ValidateCell event's data class is GridCellValidationEventArgs. The following properties provide information specific to this event:

Property Description
CellValue Gets the cell’s old valid value.
Column Gets the column that contains the processed cell.
ErrorContent Gets or sets an object that describes the validation error. Inherited from ValidationEventArgs.
ErrorType Gets or sets the error icon type. Inherited from ValidationEventArgs.
IsValid Gets or sets a value which specifies whether the value is valid. Inherited from ValidationEventArgs.
Row Gets the processed row. Inherited from GridRowValidationEventArgs.
RowHandle Gets the processed row’s handle. Inherited from GridRowValidationEventArgs.
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) Marks the processed input value as invalid and displays an error within the editor with the specified error icon type. Inherited from ValidationEventArgs.
SetError(Object) Marks the processed input value as invalid and displays an error within the editor. Inherited from ValidationEventArgs.

Remarks

The ValidateCell event occurs before the focused cell’s modified value is posted to a data source, allowing to manually validate its new value.

The focused cell’s new value is returned by the event’s CellValue property.

See Also