All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

GridViewSettings.ContextMenuInitialize Property

Enables you to customize the context menu when it is initialized.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v20.2.dll

Declaration

public ASPxGridViewContextMenuInitializeEventHandler ContextMenuInitialize { get; set; }
Public Property ContextMenuInitialize As ASPxGridViewContextMenuInitializeEventHandler

Property Value

Type Description
ASPxGridViewContextMenuInitializeEventHandler

A delegate method.

Remarks

The following example illustrates how to add a new context menu item when a user right clicks a grid row (MenuType):

settings.ContextMenuInitialize = (s, e) => {
    if(e.MenuType == GridViewContextMenuType.Rows) {
        var exportMenuItem = e.ContextMenu.Items.FindByCommand(GridViewContextMenuCommand.ExportMenu);
        exportMenuItem.Items.Add("Custom export to XLS(WYSIWYG)", "CustomExportToXLS").Image.IconID = DevExpress.Web.ASPxThemes.IconID.ExportExporttoxls16x16;
    }
};

Online Demo

See Also