System.Windows.Forms.DataGridView.CellValidating Event

Occurs when a cell loses input focus, enabling content validation.

Syntax

public event DataGridViewCellValidatingEventHandler CellValidating

Remarks

Canceling this event cancels the changes to the current cell. When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. When this event is canceled in virtual mode, the DataGridView.CellValuePushed event will not be raised.

Handle the DataGridView.CellValidated event to perform post-validation processing.

For more information about handling events, see Consuming Events.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0