Back to Devexpress

GridViewBase.RowCanceledCommand Property

wpf-devexpress-dot-xpf-dot-grid-dot-gridviewbase-6b5710f8.md

latest2.3 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public ICommand<RowCanceledArgs> RowCanceledCommand { get; set; }
vb
Public Property RowCanceledCommand As ICommand(Of RowCanceledArgs)

Property Value

TypeDescription
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

RowCanceled

GridViewBase Class

GridViewBase Members

DevExpress.Xpf.Grid Namespace