Context Menus
- 2 minutes to read
DXGrid for Silverlight can display four types of popup menus that enable an end-user to manage data (apply grouping and sorting, display summaries, etc.) and customize a View by showing and hiding its UI elements. All these menus can be customized. For example, you can remove existing menu items and/or add new items.
#Context Menus Overview
To obtain the context menu currently being displayed within a View, use the GridViewBase.GridMenu property.
Menu Type | Description | Availability | Image |
---|---|---|---|
Group Panel | This menu is shown when an end-user right-clicks within the Group Panel. | ||
Column | This menu is shown when an end-user right-clicks a column header. | ||
Row Cell | This menu is shown when an end-user right-clicks a data cell. You should manually create this menu. For an example, see How to: Display a Popup Menu for Data Cells. | ||
Summary | This menu is shown when an end-user right-clicks within the Summary Panel. | ||
Fixed Summary | This menu is shown when an end-user right-clicks within the Fixed Summary Panel. |
#Customizing Context Menus
A View provides multiple properties that allow you to customize its context menus by adding new menu items or removing existing items. These properties return a BarManagerActionCollection object that provides multiple methods used to manage menu items contained within a context menu.
NOTE
This feature is not available in DXTree
Menu Type | Property |
---|---|
Group Panel | Grid |
Column | Data |
Row Cell | Data |
Summary | Data |
Default Menu Item Names
When customizing a menu (e.g. removing or moving default items), menu items are referred to by their names. Default menu item names are listed in DefaultColumnMenuItemNames and DefaultSummaryMenuItemNames.
Adding and Moving Menu Items
How to add an item to the context menu
Removing Menu Items
How to remove an item from the context menu
To dynamically customize grid menus at runtime, handle the DataViewBase.ShowGridMenu event.
NOTE
When adding a sub item