Allows you to customize context menus.
public event PopupMenuShowingEventHandler PopupMenuShowing
Public Event PopupMenuShowing As PopupMenuShowingEventHandler
The PopupMenuShowing event's data class is PopupMenuShowingEventArgs. The following properties provide information specific to this event:
|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||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.|
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.