Xceed Grid for WinForms v4.3 Documentation
Validation process

The methods are called and events raised in the following order when the value of a cell is being edited by the end-user: 

F2 is pressed on any cell other than an InsertionCell:

  1. The cell's EnterEdit method is called. 

  2. The parent row's BeginEdit method is called.  

  3. The cell's EnteringEdit event is raised.

 

F2 is pressed on an InsertionCell:

  1. The cell's EnterEdit method is called. 

  2. The InsertionRow's BeginEdit method is called. 

  3. The AddNew method is called on the grid's collection of DataRows. 

  4. The grid's InitializingNewDataRow event is raised to initialize the default values of the newly created underlying DataRow. 

  5. The cell's EnteringEdit event is raised.

 

Tab is pressed (current cell changes):

  1. The cell's LeaveEdit method is called with its commit parameter set to true. 

  2. The Validating event is raised on the control that was used to edit the cell's content.  

  3. The cell's LeavingEdit event is raised. If the value of the cell fails the validation process, the cell's ValidationError event is raised. 

  4. The cell's ValueChanging event is raised. If the operation is cancelled, no other methods are called or events raised. 

  5. The cell's ValueChanged event is raised. 

  6. The cell's parent row's CellValueChanged event is raised.

Enter is pressed on any cell other than an InsertionCell or the current row changes:

  1. The CellRow's EndEdit method is called raising the row's EndingEdit event. If the value of one of the cell's in the row fails the validation process, the row's ValidationError event is raised. 

  2. In the EndingEdit event, if the operation is cancelled, the CellRow's CancelEdit method is called raising the cell's ValueChanged event followed by the CellRow's CellValueChanged event. 

  3. In the EndingEdit event, if the operation is not cancelled and the row is a DataRow, the DataRow's CellValueChanged, DataRowsChanged and SiblingDataRowsChanged events are raised.

 

Enter is pressed on an InsertionCell or the current row changes:

  1. The InsertionRow's EndEdit method is called raising the EndingEdit event.
     

  2. In the InsertionRow's EndingEdit event, if the operation is cancelled, the InsertionRow's ValidationError event is raised followed by a call to the underlying CancelEdit method.  

  3. If the operation is not cancelled in the InsertionRow's EndingEdit event , the underlying DataRow's EndEdit method is called raising the EndingEdit event followed by the CellValueChanged, DataRowsChanged and SiblingDataRowsChanged events.  

  4. If an error occurs while calling the underlying DataRow's EndEdit method, the DataRow's ValidationError event is raised 

  5. In the DataRow's EndingEdit event, if the operation is cancelled, the DataRow's ValidationError event is raised. 

  6. In the DataRow's ValidationError event, if the operation is cancelled,  the DataRow's CancelEdit and Remove methods are called. 

  7. If the operation is not cancelled in the DataRow's ValidationError event, the InsertionRow's ValidationError is raised.

 

Escape is pressed when editing a cell:

  1. The cell's LeaveEdit is called with its commit parameter set to false.

 

Escape is pressed when a cell is not being edited in an InsertionRow:

  1. The InsertionRow's CancelEdit method is called followed by a call to the underlying DataRows CancelEdit method. 

  2. The underlying DataRow's Remove method is then called.

 

Escape is pressed when a cell is not being edited in any row other than an InsertionRow:

  1. The row's CancelEdit method is called. 

  2. The cell's ValueChanged event is raised followed by the parent row's CellValueChanged event.

 

The methods are called and events raised in the following order when a new row is being added to the grid by code:

  1. The AddNew method is called on the grid's collection of DataRows

  2. The grid's InitializingNewDataRow event is raised to initialize the default values of the newly created DataRow.

 

The methods are called and events raised in the following order when a new row is being committed to the grid by code:

  1. The DataRow's EndEdit method is called raising the row's EndingEdit event. If the value of one of the cell's in the row fails the validation process, the row's ValidationError event is raised. 

  2. In the EndingEdit event, if the operation is cancelled, the DataRow's CancelEdit method is called raising the cell's ValueChanging and ValueChanged events. 

  3. The DataRow's CellValueChanged event is raised as well as the DataRowsChanged and SiblingDataRowsChanged events.