Back to Devexpress

PopupMenuShowingEventArgs.MenuType Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-popupmenushowingeventargs-ad3f6a37.md

latest5.0 KB
Original Source

PopupMenuShowingEventArgs.MenuType Property

Gets the type of the Grid View’s menu to be invoked.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDescription
GridMenuType

A GridMenuType enumeration value that specifies the type of the Grid View’s menu to be invoked.

|

Available values:

NameDescription
User

Custom context menu.

| | Summary |

Context menu for a summary footer.

| | Column |

Context menu for a column header.

| | Group |

Context menu for the group panel.

| | Row |

Context menu for a data row.

| | AutoFilter |

Context menu for the auto-filter row.

| | GroupRow |

Context menu for a group row.

|

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-grid-customize-footer-menu-calculate-custom-totals/CS/Form1.cs#L49

csharp
{
    if (e.MenuType != DevExpress.XtraGrid.Views.Grid.GridMenuType.Summary) return;

winforms-grid-show-context-menu-for-rows/CS/FormGridMenu.cs#L16

csharp
private void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if (e.MenuType == GridMenuType.Row) {
        popupMenu_Row.Tag = e.HitInfo;

winforms-grid-customize-footer-menu-calculate-custom-totals/VB/Form1.vb#L43

vb
Private Sub gridView1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
    If e.MenuType <> GridMenuType.Summary Then Return
    Dim footerMenu As DevExpress.XtraGrid.Menu.GridViewFooterMenu = TryCast(e.Menu, DevExpress.XtraGrid.Menu.GridViewFooterMenu)

winforms-grid-show-context-menu-for-rows/VB/FormGridMenu.vb#L17

vb
Private Sub gridView1_PopupMenuShowing(sender As Object, e As PopupMenuShowingEventArgs)
    If e.MenuType = GridMenuType.Row Then
        popupMenu_Row.Tag = e.HitInfo

See Also

PopupMenuShowingEventArgs Class

PopupMenuShowingEventArgs Members

DevExpress.XtraGrid.Views.Grid Namespace