Freigeben über


DataGrid.CommitEdit Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Causes the data grid to commit the current edit to the data source, and optionally exit editing mode.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method CommitEdit() Causes the data grid to commit the current edit to the data source and exit editing mode.
Public method CommitEdit(DataGridEditingUnit, Boolean) Causes the data grid to commit the current edit to the data source, and optionally exit editing mode.

Top

Remarks

By default, you can edit items directly in the DataGrid. A cell-level edit is committed when you move to another cell in the same row. All edits in a row are committed when you press ENTER or move to another row. To guarantee that edits can be committed and canceled correctly, the objects in the DataGrid must implement the IEditableObject interface. Alternatively, you can set the IsReadOnly property to true to disable editing in the DataGrid.