Skip to main content
A newer version of this page is available. .

PivotGridControl.PopupMenuShowing Event

Allows you to customize context menus.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.2.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public event PopupMenuShowingEventHandler PopupMenuShowing

Event Data

The PopupMenuShowing event's data class is PopupMenuShowingEventArgs. 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 or value has been right-clicked by an end-user.
HitInfo Gets info about the point where the context menu should be invoked.
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 PivotGrid control provides several context menus to end-users. The availability of these menus is controlled by the PivotGrid control’s PivotGridControl.OptionsMenu property.

If the PivotGridControl.OptionsMenu property allows the menu to be invoked, the PopupMenuShowing event fires each time an end-user attempts to invoke a context menu. This event enables you to identify which menu is about to be displayed, customize the menu or prevent it from being invoked.

Use the event parameter’s PivotGridMenuEventArgsBase.Point and PopupMenuShowingEventArgs.HitInfo properties to identify the right-clicked point and obtain which element is located under the point, respectively. If the point is located inside a field header or field value, use the PopupMenuShowingEventArgs.Field and PivotGridMenuEventArgsBase.Area properties, to identify which field has been right-clicked, and in which area this field resides, respectively.

Use the PivotGridMenuEventArgsBase.Menu property to obtain the context menu about to be displayed, and customize it. The type of the menu is identified via the PivotGridMenuEventArgsBase.MenuType property.

To specify whether to invoke the context menu, use the PivotGridMenuEventArgsBase.Allow property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the PopupMenuShowing event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also