DataGrid.CancelEdit Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes the CancelEditCommand command for the cell or row currently in edit mode.
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. |
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.
Applies to
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
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
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: