แก้ไข

แชร์ผ่าน


DataGrid.CommitEdit Method

Definition

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

Overloads

CommitEdit()

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

CommitEdit(DataGridEditingUnit, Boolean)

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

CommitEdit()

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

public:
 bool CommitEdit();
public bool CommitEdit ();
member this.CommitEdit : unit -> bool
Public Function CommitEdit () 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 being edited, this method commits any pending changes to the cell without committing any pending changes to the row. This means that changes are propagated from the cell editing control to the pending row. If a cell is not currently being edited, all pending row edits are committed.

Applies to

CommitEdit(DataGridEditingUnit, Boolean)

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

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

Parameters

editingUnit
DataGridEditingUnit

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

exitEditingMode
Boolean

true to exit edit mode; otherwise, false.

Returns

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

Remarks

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

Applies to