Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

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

#Property Value

Type Description
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