Skip to main content
All docs
V25.1
  • Tab

    ASPxGridViewContextMenuInitializeEventArgs.MenuType Property

    Gets the context menu type.

    Namespace: DevExpress.Web

    Assembly: DevExpress.Web.v25.1.dll

    #Declaration

    public GridViewContextMenuType MenuType { get; }

    #Property Value

    Type Description
    GridViewContextMenuType

    The context menu type.

    Available values:

    Name Description
    GroupPanel

    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.

    GroupFooter

    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