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
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