Skip to main content

GridViewSettings.ContextMenuInitialize Property

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

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.1.dll

NuGet Package: DevExpress.Web.Mvc5


public ASPxGridViewContextMenuInitializeEventHandler ContextMenuInitialize { get; set; }

Property Value

Type Description

A delegate method.


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