GridContextMenuInfoBase.Grid Property
In This Article
Provides the target GridControl instance for the current context menu.
Namespace: DevExpress.UI.Xaml.Grid
Assembly: DevExpress.UI.Xaml.Grid.v21.2.dll
NuGet Package: DevExpress.Uwp.Controls
#Declaration
public GridControl Grid { get; }
#Property Value
Type |
---|
Grid |
#Remarks
Use this property to get access to a target GridControl instance. If your custom commands are defined in the view model from the GridControl’s DataContext, you can bind to them as illustrated in the XAML snippet below.
xmlns:dxg="using:DevExpress.UI.Xaml.Grid"
xmlns:dxr="using:DevExpress.UI.Xaml.Ribbon"
<dxg:GridControl ...>
<dxg:GridControl.RowCellMenu>
<dxr:ContextToolbarControl Orientation="Vertical">
<dxr:ContextToolbarGroup>
<dxr:ContextToolbarButton Content="Duplicate"
Command="{Binding Grid.DataContext.DuplicateCommand}"
CommandParameter="{Binding Row.Row}"/>
<dxr:ContextToolbarButton Content="Delete"
Command="{Binding Grid.DataContext.DeleteCommand}"
CommandParameter="{Binding Row.Row}"/>
</dxr:ContextToolbarGroup>
</dxr:ContextToolbarControl>
</dxg:GridControl.RowCellMenu>
</dxg:GridControl>
Note
A complete sample project is available at https://github.
See Also