Back to Devexpress

DataViewCommandsBase.DeleteFocusedRow Property

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewcommandsbase.md

latest3.6 KB
Original Source

DataViewCommandsBase.DeleteFocusedRow Property

Deletes the focused row.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public ICommand DeleteFocusedRow { get; }
vb
Public ReadOnly Property DeleteFocusedRow As ICommand

Property Value

TypeDescription
ICommand

A command implementing the ICommand.

|

Remarks

To delete the focused row, pass the DataViewBase.FocusedRowHandle to the GridViewBase.DeleteRow method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DeleteFocusedRow property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-data-grid-implement-crud-operations/CS/CodeBehind/EFCore/LocalData/MainWindow.xaml#L20

xml
Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Add.svg}" BarItemDisplayMode="ContentAndGlyph" />
<dxb:BarButtonItem Content="Delete (Del)" Command="{Binding View.Commands.DeleteFocusedRow, ElementName=grid}"
                   Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Delete.svg}" BarItemDisplayMode="ContentAndGlyph" />

wpf-data-grid-extend-crud-operations/CS/AsyncCRUDOperations/MainWindow.xaml#L18

xml
<dxb:BarButtonItem Content="New" Command="{Binding View.Commands.AddNewRow, ElementName=grid}" Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Add.svg}" BarItemDisplayMode="ContentAndGlyph" />
    <dxb:BarButtonItem Content="Delete (Del)" Command="{Binding View.Commands.DeleteFocusedRow, ElementName=grid}" Glyph="{dx:DXImage SvgImages/Icon Builder/Actions_Delete.svg}" BarItemDisplayMode="ContentAndGlyph" />
</dxb:ToolBarControl>

wpf-data-grid-bind-to-infiniteasyncsource/CS/InfiniteAsyncSourceSample/MainWindow.xaml#L14

xml
<dxg:GridControl.InputBindings>
    <KeyBinding Command="{Binding ElementName=view, Path=Commands.DeleteFocusedRow}" CommandTarget="{Binding ElementName=view}" Key="Delete"/>
</dxg:GridControl.InputBindings>

See Also

DataViewCommandsBase Class

DataViewCommandsBase Members

DevExpress.Xpf.Grid Namespace