Back to Devexpress

PopupMenuShowingEventArgs.MenuType Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-popupmenushowingeventargs-69d5470d.md

latest3.9 KB
Original Source

PopupMenuShowingEventArgs.MenuType Property

Gets what kind of pivot grid element invokes the menu.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

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

Property Value

TypeDescription
PivotGridMenuType

A PivotGridMenuType enumeration value that identifies the context menu type.

|

Available values:

NameDescription
HeadersArea

Header area context menu.

| | Header |

Field header context menu.

| | FieldValue |

Field value context menu.

| | FilterPopup |

Filter popup context menu.

| | None |

No menu.

| | Cell |

Cell context menu.

|

Remarks

Use the MenuType property to determine for what kind of pivot grid element (a cell, a field value, a field header or the field header area) the menu is invoked. To obtain the actual visual element, use the PopupMenuShowingEventArgs.TargetElement property.

To learn more, see Context Menus.

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.

wpf-pivot-grid-change-summary-display-type/CS/HeaderMenuCustomizationExample/HeaderMenuHelper.cs#L55

csharp
static void pivotGrid_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if (e.MenuType == PivotGridMenuType.Header) {
        PivotGridControl pivot = (PivotGridControl)sender;

wpf-pivot-grid-change-summary-display-type/VB/HeaderMenuCustomizationExample/HeaderMenuHelper.vb#L50

vb
Private Shared Sub pivotGrid_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
    If e.MenuType = PivotGridMenuType.Header Then
        Dim pivot As PivotGridControl = CType(sender, PivotGridControl)

See Also

TargetElement

Context Menus

PopupMenuShowingEventArgs Class

PopupMenuShowingEventArgs Members

DevExpress.Xpf.PivotGrid Namespace