GridControl.GroupPanelMenu Property
Gets or sets a context menu that is invoked when a user right-clicks the Group Panel.
Namespace: DevExpress.WinUI.Grid
Assembly: DevExpress.WinUI.Grid.v23.2.dll
NuGet Package: DevExpress.WinUI
#Declaration
#Property Value
Type | Description |
---|---|
Object | A UI element invoked when a user right-clicks the Group Panel. |
#Remarks
The GroupPanelMenu property allows you to define a custom context menu for the group panel. To do this, assign a MenuFlyout control to this property.
When you assign a menu control to the GroupPanelMenu property, this control’s DataContext is set to an object of the GridGroupPanelContextMenuInfo type. This class contains information about the GridControl, the view model stored in its DataContext, and so on. You can use this information to process user actions at the view model level.
The following code sample demonstrates how to specify the group panel‘s context menu:
<dxg:GridControl ...
ShowGroupPanel="True">
<dxg:GridControl.GroupPanelMenu>
<MenuFlyout>
<MenuFlyoutItem Text="Expand All Groups"
Command="{Binding Commands.ExpandAllGroups}"/>
<MenuFlyoutItem Text="Collapse All Groups"
Command="{Binding Commands.CollapseAllGroups}"/>
</MenuFlyout>
</dxg:GridControl.GroupPanelMenu>
</dxg:GridControl>