The ASPxGridView context menu is a popup menu displayed when an end-user right-clicks a grid element. The following context menu types are available.
Browser context menu is a browser-dependent menu allowing you to perform commands related to your browser functionality. This type of menu is displayed by default.
Grid context menu is a built-in context menu that provides a capability to perform the most popular grid commands (e.g., data editing, sorting). You can enable this menu by setting just one property. The menu default items can be easily shown or hidden, or supplemented with custom items.
The browser context menu is displayed in a grid by default. The menu appearance and content depend on an end-user's browser.
The image above provides an example of a browser's context menu. You can see that it does not relate to grid functionality and provides browser-related commands only. To provide a grid-related context menu - enable the built-in grid context menu.
It might not be required (for some reason) to display the built-in grid menu for particular elements (such as for group rows) and display the browser menu instead. This particular scenario is demonstrated in the given code.
Note that you can enable only menus of a particular type (e.g. hide the context menu for a group panel), as well as show/hide specific menu items. The corresponding properties are listed in a table below.
You can populate a grid context menu with custom items using the ASPxGridView.FillContextMenuItems event. The event is raised after default context menu items are created and before the context menu is shown; and enables you to customize the item collection.
Protected Sub MyGridView_FillContextMenuItems(ByVal sender As Object, ByVal e As ASPxGridViewContextMenuEventArgs)
e.Items.Add("Select All", "SelectAll")
e.Items.Add("Deselect All", "DeselectAll")
How to Determine a Type of Context Menu That Will be Displayed for a Grid Element
When you enable different types of context menus for a grid, it can be difficult to determine which of the menus will be displayed for a particular element. The diagram below helps you to determine the displayed menu type.