Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridMenuEventArgs.MenuInfo Property

Gets information about the context menu.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public GridMenuInfo MenuInfo { get; }

#Property Value

Type Description
GridMenuInfo

A GridMenuInfo object that contains information about the context menu.

#Remarks

#Example

The following example demonstrates how to show the row cell’s context menu item if you sort data against the current column:

Subscribe to the DataViewBase.ShowGridMenu event and get column objects from e.MenuInfo.

<dxg:TableView ShowGridMenu="TableView_ShowGridMenu" />
void TableView_ShowGridMenu(object sender, GridMenuEventArgs e)
{
    if (e.MenuType != GridMenuType.RowCell)
        return;
    GridCellMenuInfo info = (GridCellMenuInfo)e.MenuInfo;
    ColumnBase item = (ColumnBase)info.Column;
    if (item.IsSorted)
        e.Customizations.Add(new BarButtonItem { Content = "Item 1" });
    e.Customizations.Add(new BarButtonItem { Content = "Item 2" });
}
See Also