DataGrid.CancelEdit Method

Definition

Invokes the CancelEditCommand command for the cell or row currently in edit mode.

Overloads

CancelEdit()

Invokes the CancelEditCommand command for the cell or row currently in edit mode.

CancelEdit(DataGridEditingUnit)

Invokes the CancelEditCommand command for the specified cell or row in edit mode.

CancelEdit()

Invokes the CancelEditCommand command for the cell or row currently in edit mode.

public:
 bool CancelEdit();
public bool CancelEdit ();
member this.CancelEdit : unit -> bool
Public Function CancelEdit () As Boolean

Returns

true if the current cell or row exits edit mode, or if no cells or rows are in edit mode; otherwise, false.

Remarks

If a cell is currently in edit mode, the CancelEdit method cancels the cell edit, but not any pending row edits. If a cell is not in edit mode, CancelEdit cancels all pending row edits.

CancelEdit(DataGridEditingUnit)

Invokes the CancelEditCommand command for the specified cell or row in edit mode.

public:
 bool CancelEdit(System::Windows::Controls::DataGridEditingUnit editingUnit);
public bool CancelEdit (System.Windows.Controls.DataGridEditingUnit editingUnit);
member this.CancelEdit : System.Windows.Controls.DataGridEditingUnit -> bool
Public Function CancelEdit (editingUnit As DataGridEditingUnit) As Boolean

Parameters

editingUnit
DataGridEditingUnit

One of the enumeration values that specifies whether to cancel row or cell edits.

Returns

true if the current cell or row exits edit mode; otherwise, false.

Remarks

This method reverts any pending editing changes for the specified DataGridEditingUnit and exits edit mode.

Applies to