Skip to main content
A newer version of this page is available. .
All docs
V21.1

GridViewBase.RowCanceledCommand Property

Gets or sets a command that is executed when the changes made in a row are discarded.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v21.1.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public ICommand<RowCanceledArgs> RowCanceledCommand { get; set; }

Property Value

Type Description
DevExpress.Mvvm.ICommand<RowCanceledArgs>

A command that is executed when the changes made in a row are discarded.

Remarks

Bind a command to the RowCanceledCommand property to maintain a clean MVVM pattern. The command works like a RowCanceled event handler and allows you to process the row edit discard operation in a View Model.

You can discard changes made in a row while it is focused. The GridControl updates the data source when the row focus moves to another row.

To discard changes, press ESC twice. Press ESC the first time to close the editor and discard all the changes made in the current cell. Then press ESC again to call the IEditableObject.CancelEdit method that discards changes made in other cells of the edited row.

The bound command is called when you press ESC the second time.

Note

If a data item class does not implement the IEditableObject interface, you can discard changes only in the focused cell.

Refer to the following topic if you want to cancel changes made within a row asynchronously: ResultAsync.

See Also