PivotGridControl.MenuItemClick Event
Allows custom responses to be provided for clicks on context menu items.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.2.dll
NuGet Package: DevExpress.Win.PivotGrid
#Declaration
public event PivotGridMenuItemClickEventHandler MenuItemClick
#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 Base |
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 Pivot |
Field | Gets the field whose header has been right-clicked by an end-user. |
Hit |
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 Pivot |
Menu |
Gets or sets the Pivot Grid’s context menu.
Inherited from Pivot |
Menu |
Gets the type of the invoked menu.
Inherited from Pivot |
Point |
Gets or sets coordinates of the invoked context menu (top-left corner) relative to the parent control.
Inherited from Base |
Screen |
Gets coordinates of the invoked context menu (top-left corner) relative to the screen.
Inherited from Base |
The event data class exposes the following methods:
Method | Description |
---|---|
Show |
Invokes a custom context menu instead of the control’s menu.
Inherited from Base |
Show |
Invokes a custom context menu instead of the control’s menu.
Inherited from Base |
#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.