GridMenuType Enum
Lists values that specify the context menu type.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v19.1.Core.dll
Declaration
Members
Name | Description |
---|---|
Column
|
Corresponds to a menu invoked for a column header. |
TotalSummary
|
Corresponds to a menu invoked for the Summary Panel. |
RowCell
|
Corresponds to a menu invoked for the Row Cell. |
GroupPanel
|
Corresponds to a menu invoked for the group panel. |
FixedTotalSummary
|
Corresponds to a menu invoked for the Fixed Summary Panel. |
Band
|
Corresponds to a menu invoked for a band. |
GroupFooterSummary
|
Corresponds to a menu invoked for the Group Footer‘s summary. |
GroupRow
|
Corresponds to a menu invoked for the group row. |
FixRowControl
|
Corresponds to a menu invoked for a fix row button. |
CompactPanelSortElement
|
Corresponds to a menu invoked for sort items in compact panel. |
CompactPanelFilter
|
Corresponds to a menu invoked for a compact panel filter. |
CompactPanelMergeMenu
|
Corresponds to a merged menu invoked for a filter and sort items in compact panel. |
Related API Members
The following properties accept/return GridMenuType values:
Remarks
The values listed by this enumeration are used to set the GridMenuInfo property’s value.
Example
The following example demonstrates how to customize the grid’s context menu at runtime. For instance this sample demonstrates how to remove the default ‘Show Column Chooser’ menu item from the Column Context Menu, and add a custom item instead.
For this, it is necessary to handle the DataViewBase.ShowGridMenu event. In the event handler, all modifications to the list of menu items can be done by changing the GridMenuEventArgs.Customizations collection. To remove a specific menu item along with its link, use the RemoveBarItemAndLinkAction instance, and to add a custom menu item, a new BarButtonItem object must be added to the e.Customizations collection.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-modify-the-context-menu-of-grid-columns-e1837.
<dxg:GridControl.View>
<dxg:TableView ShowGridMenu="TableView_ShowGridMenu" />
</dxg:GridControl.View>