Skip to main content

PopupMenuEventArgs.MenuType Property

Gets the type of the grid’s menu to be invoked.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.2.dll

Declaration

public GridPopupMenuType MenuType { get; }

Property Value

Type Description
GridPopupMenuType

A GridPopupMenuType enumeration value that identifies the grid’s popup menu to be invoked.

Available values:

Name Description
Header

A menu shown when an end-user touches and holds a column header.

DataRow

A context shown when an end-user touches and holds a data row cell.

GroupRow

A menu shown when an end-user touches and holds a group row.

TotalSummary

A menu shown when an end-user touches and holds a total summary panel.

Remarks

Important

This documentation topic describes legacy technology. We no longer develop new functionality for the GridControl and suggest that you use the new DataGridView control instead.

Example

The following sample code handles the GridControl.PopupMenuCustomization event to customize the data row popup menu before it is displayed. The code clears default menu items and adds new ones. One of these custom items applies a specific filter to the grid data and another one clears this filter.

GridControl_CustomPopupMenu

using DevExpress.Mobile.DataGrid;
using DevExpress.Mobile.Core;
// ...

void OnPopupMenuCustomization(object sender, PopupMenuEventArgs e) {
    if (e.MenuType == GridPopupMenuType.DataRow) {
        e.Menu.Items.Clear();
        PopupMenuItem itemFilter = new PopupMenuItem();
        itemFilter.Caption = "Filter by Product";
        itemFilter.Click += ItemFilterClick;
        e.Menu.Items.Insert(0, itemFilter);

        PopupMenuItem itemClearFilter = new PopupMenuItem();
        itemClearFilter.Caption = "Clear Filter";
        itemClearFilter.Click += ItemClearFilterClick;
        e.Menu.Items.Insert(1, itemClearFilter);
    }
}

void ItemFilterClick(object sender, EventArgs e) {
    IRowData rowData = grid.GetRow(grid.SelectedRowHandle);
    Order selectedOrder = rowData.DataObject as Order;
    string productName = selectedOrder.Product.Name;
    grid.Columns ["Product.Name"].AutoFilterValue = productName;
}

void ItemClearFilterClick(object sender, EventArgs e) {
    grid.ClearFilter ();
}
See Also