Skip to main content
All docs
V21.2

ASPxClientGanttContextMenuItemCollection Class

The context menu item collection.

Declaration

declare class ASPxClientGanttContextMenuItemCollection

Remarks

Run Demo: ASPxGantt - Context Menu Run Demo: MVCxGantt - Context Menu

Web Forms:

<dx:ASPxGantt ID="Gantt" ClientInstanceName="clientGantt" >
    //...
    <ClientSideEvents
      ContextMenuCustomization="function(s, e) {
          // Removes default context menu items
          e.menuItems.Clear();

          // Creates a custom context menu item
          var customItem = new ASPxClientGanttContextMenuItem();
          customItem.name = 'ToggleResourcesVisibility';
          customItem.text = 'Toggle Resources Visibility';
          customItem.beginGroup = true;

          // Adds a custom context menu item
          e.menuItems.Add(customItem);
      }
    />
</dx:ASPxGantt>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.ClientSideEvents.ContextMenuCustomization = "function (s, e) { 
        // Removes default context menu items
        e.menuItems.Clear();

        // Creates a custom context menu item
        var customItem = new ASPxClientGanttContextMenuItem();
        customItem.name = 'ToggleResourcesVisibility';
        customItem.text = 'Toggle Resources Visibility';
        customItem.beginGroup = true;

        // Adds a custom context menu item
        e.menuItems.Add(customItem);
    }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()

Examples

See Also