Skip to main content

PivotGridControl.MenuItemClick Event

Allows custom responses to be provided for clicks on context menu items.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v23.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 allow the action. Inherited from PivotGridMenuEventArgsBase.
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 the location at which the context menu has been invoked. Inherited from PivotGridMenuEventArgsBase.

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.

See Also