Skip to main content
A newer version of this page is available. .

GridControl.GroupPanelMenu Property

Gets or sets the context menu that is invoked when the end-user right-clicks within the Group Panel.

Namespace: DevExpress.UI.Xaml.Grid

Assembly: DevExpress.UI.Xaml.Grid.v19.2.dll

Declaration

public object GroupPanelMenu { get; set; }

Property Value

Type Description
Object

The UI element invoked when the end-user right-clicks within the Group Panel.

Remarks

The GroupPanelMenu property allows you to define a custom Context Menu for GridControl Group Panel. You can set this property to either the standard MenuFlyout control, or the ContextToolbarControl and ToolbarControl from the DevExpress suite.

When you define a menu control in GroupPanelMenu, this control’s DataContext is set to an object of the GridGroupPanelContextMenuInfo class. This class provides information about the GridControl, a view model from its DataContext, etc. You can use this information to process different actions at your view model level.

The XANK snippet below illustrates how to set a ContextToolbarControl as the GroupPanelMenu property value:

xmlns:dxg="using:DevExpress.UI.Xaml.Grid"
xmlns:dxr="using:DevExpress.UI.Xaml.Ribbon"

<dxg:GridControl    AllowGrouping="True"
                    ShowGroupPanel="True" ...>
    <dxg:GridControl.GroupPanelMenu>
        <dxr:ContextToolbarControl Orientation="Vertical">
            <dxr:ContextToolbarGroup>
                <dxr:ContextToolbarButton Content="Expand All Groups"
                                        Command="{Binding Commands.ExpandAllGroups}"/>
                <dxr:ContextToolbarButton Content="Collapse All Groups"
                                        Command="{Binding Commands.CollapseAllGroups}"/>
            </dxr:ContextToolbarGroup>
        </dxr:ContextToolbarControl>
    </dxg:GridControl.GroupPanelMenu>
</dxg:GridControl>
See Also