wpf-devexpress-dot-xpf-dot-grid-dot-dataviewcommandsbase.md
Deletes the focused row.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public ICommand DeleteFocusedRow { get; }
Public ReadOnly Property DeleteFocusedRow As ICommand
| Type | Description |
|---|---|
| ICommand |
A command implementing the ICommand.
|
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
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
<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
<dxg:GridControl.InputBindings>
<KeyBinding Command="{Binding ElementName=view, Path=Commands.DeleteFocusedRow}" CommandTarget="{Binding ElementName=view}" Key="Delete"/>
</dxg:GridControl.InputBindings>
See Also