True if changes can be discarded; False otherwise.

Deactivate Method (GridCurrentCell)

Deactivates the current cell and confirms or rejects changes made to the current cell.
Public Function Deactivate( _
   ByVal discardChanges As Boolean _
) As Boolean
Dim instance As GridCurrentCell
Dim discardChanges As Boolean
Dim value As Boolean
value = instance.Deactivate(discardChanges)
public bool Deactivate( 
   bool discardChanges


True if changes can be discarded; False otherwise.

Return Value

True if current cell can be deactivated; False otherwise.
Deactivate raises a cancelable CurrentCellDeactivating event. If the event handler set the System.ComponentModel.CancelEventArgs.Cancel flag of the System.ComponentModel.CancelEventArgs object, the method will return.

Next, it checks if the cell is modified and depending on the value of the discardChanges parameter, it tries to confirm changes by calling ConfirmChanges or discarding changes by calling RejectChanges. Also, any open drop-down windows will be closed at this time.

Above method calls will raise CurrentCellValidating then CurrentCellValidated and CurrentCellAcceptedChanges or CurrentCellRejectedChanges events followed by a CurrentCellEditingComplete event if the cell was in editing mode.

After the changes have been saved or canceled, the cell area is invalidated and a CurrentCellDeactivated event is raised which completes this operation.

If an exception occurred or if a event handler requested to cancel the operation, Deactivate will instead close the operation with a CurrentCellDeactivateFailed event.

This ensures that you will get guaranteed either a CurrentCellDeactivated or CurrentCellDeactivateFailed event after a CurrentCellDeactivating event.

When current cell has been deactivated, the HasCurrentCell property will be false indicating the grid has no active current cell at this time.


Syncfusion.Grid.Windows: 17.3460.0.26

See Also