Skip to main content

DataViewBase.CommitEditing() Method

Hides the active editor and posts all the changes made within the focused row to a data source if the row values are valid.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public bool CommitEditing()

Returns

Type Description
Boolean

true if the values within the focused row’s cells are valid; otherwise, false.

Remarks

By default, the grid automatically validates the changes made within the focused row when the row focus is about to be moved to another row. If all the new values are valid, they are posted to the grid’s data source. Otherwise, the row remains focused until an end-user corrects invalid values. To manually force the row’s validation, use the CommitEditing method. If the validation fails, new values are not posted to a data source, and the CommitEditing method returns false. Otherwise, new values are saved and the CommitEditing method returns true.

Calling the CommitEditing method for the master view will commit changes in the currently edited detail row.

The CommitEditing method has no effect if Edit Entire Row mode is enabled. In this case, use the TableView.UpdateRow / TreeListView.UpdateRow method to post changes to a data source.

Refer to the following help topic for more information: Row Validation.

See Also