Back to Devexpress

PivotGridMenuEventArgsBase.MenuType Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridmenueventargsbase-26287e1e.md

latest5.3 KB
Original Source

PivotGridMenuEventArgsBase.MenuType Property

Gets the type of the invoked menu.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public PivotGridMenuType MenuType { get; }
vb
Public ReadOnly Property MenuType As PivotGridMenuType

Property Value

TypeDescription
PivotGridMenuType

A PivotGridMenuType enumeration member which specifies the menu’s type.

|

Available values:

NameDescription
Header

Corresponds to the field header context menu.

| | HeaderArea |

Corresponds to the header area context menu.

| | FieldValue |

Corresponds to the field value context menu.

| | HeaderSummaries |

Corresponds to the menu allowing an end-user to select a summary type for a data field (when the PivotGridFieldOptions.AllowRunTimeSummaryChange option is enabled).

| | Cell |

Corresponds to the context menu, allowing end-users to apply conditional formatting to data cells (when the PivotGridOptionsMenu.EnableFormatRulesMenu option is enabled).

|

Remarks

To obtain the actual context menu invoked, use the PivotGridMenuEventArgsBase.Menu property.

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

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.

winforms-pivot-totals-visibility/CS/Form1.cs#L18

csharp
void pivotGridControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if (e.MenuType == PivotGridMenuType.Header) {
        HandleHeaderShowMenu(e);

winforms-pivot-change-summarydisplaytype-in-context-menu/CS/WindowsApplication34/Form1.cs#L36

csharp
void pivotGridControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if (e.MenuType == PivotGridMenuType.Header && e.HitInfo.HeaderField.Area == PivotArea.DataArea) {
        DXSubMenuItem sdtItem = new DXSubMenuItem();

winforms-pivot-totals-visibility/VB/Form1.vb#L21

vb
Private Sub pivotGridControl1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs) Handles pivotGridControl1.PopupMenuShowing
    If e.MenuType = PivotGridMenuType.Header Then
        HandleHeaderShowMenu(e)

winforms-pivot-change-summarydisplaytype-in-context-menu/VB/WindowsApplication34/Form1.vb#L39

vb
Private Sub pivotGridControl1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
    If e.MenuType = PivotGridMenuType.Header AndAlso e.HitInfo.HeaderField.Area = PivotArea.DataArea Then
        Dim sdtItem As New DXSubMenuItem()

See Also

Menu

PivotGridMenuEventArgsBase Class

PivotGridMenuEventArgsBase Members

DevExpress.XtraPivotGrid Namespace