PivotGridControl.MenuItemClick Event
Allows custom responses to be provided for clicks on context menu items.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.2.dll
Declaration
Event Data
The MenuItemClick event's data class is PivotGridMenuItemClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Allow | Gets or sets whether to display the context menu. Inherited from BasePopupMenuShowingEventArgs. |
Area | Gets the area of the field whose header or value has been right-clicked by a user to invoke the context menu. Inherited from PivotGridMenuEventArgsBase. |
Field | Gets the field whose header has been right-clicked by an end-user. |
HitInfo | Gets details on the grid elements located at the point where an end-user has right-clicked to invoke the context menu. |
Item | Gets the menu item that has been clicked. Inherited from PivotGridMenuItemClickEventArgsBase. |
Menu | Gets or sets the Pivot Grid’s context menu. Inherited from PivotGridMenuEventArgsBase. |
MenuType | Gets the type of the invoked menu. Inherited from PivotGridMenuEventArgsBase. |
Point | Gets or sets coordinates of the invoked context menu (top-left corner) relative to the parent control. Inherited from BasePopupMenuShowingEventArgs. |
ScreenPoint | Gets coordinates of the invoked context menu (top-left corner) relative to the screen. Inherited from BasePopupMenuShowingEventArgs. |
The event data class exposes the following methods:
Method | Description |
---|---|
ShowCustomMenu(IDXDropDownControlEx) | Invokes a custom context menu instead of the control’s menu. Inherited from BasePopupMenuShowingEventArgs. |
ShowCustomMenu(ContextMenuStrip) | Invokes a custom context menu instead of the control’s menu. Inherited from BasePopupMenuShowingEventArgs. |
Remarks
The MenuItemClick event fires when selecting a specific item within a Pivot Grid Control’s menus. It enables you to cancel the default actions performed when a particular item is clicked, and instead, implement your own handling. The clicked item is represented by the event’s PivotGridMenuItemClickEventArgsBase.Item parameter.
You can identify the clicked item using the Item.Tag property. Tags of standard menu items are listed by static fields of the PivotContextMenuIds abstract class. Use values of these fields to identify a particular menu item. For the ‘Sort … by This Column/Row’ items displayed in column/row header context menus and used to apply Sorting by Summary, the DXMenuItem.Tag property stores a PivotGridFieldPair object that refers to the current data and column/row fields.
The MenuItemClick event is not raised when menu items created manually are clicked. Custom items can be added to menus via the PivotGridControl.PopupMenuShowing event handler.