ASPxGridViewContextMenuInitializeEventArgs.MenuType Property
In This Article
Gets the context menu type.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public GridViewContextMenuType MenuType { get; }
#Property Value
Type | Description |
---|---|
Grid |
The context menu type. |
Available values:
Name | Description |
---|---|
Group |
Identifies the group panel context menu. |
Columns | Identifies the column header context menu. |
Rows | Identifies a row context menu. |
Footer | Identifies the footer context menu. |
Group |
Identifies the group footer context menu. |
#Remarks
The following example illustrates how to add a new context menu item when a user right clicks a grid row (MenuType):
<dx:ASPxGridView ID="Grid" OnContextMenuInitialize="Grid_ContextMenuInitialize" >
...
</dx:ASPxGridView>
protected void Grid_ContextMenuInitialize(object sender, ASPxGridViewContextMenuInitializeEventArgs e) {
if(e.MenuType == GridViewContextMenuType.Rows) {
e.ContextMenu.Items.Add("Item name", "Command name");
}
}
#Online Demo
See Also