Skip to main content
All docs
V21.2

ASPxClientGanttContextMenuCustomizationEventArgs Class

Contains data for the ContextMenuCustomization event.

Declaration

declare class ASPxClientGanttContextMenuCustomizationEventArgs extends ASPxClientCancelEventArgs

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);
      }
      CustomCommand="function(s, e) {
          if(e.commandName == 'ToggleResourcesVisibility') {
              showResources = !showResources;
              clientGantt.ShowResources(showResources);
          }
      }
    />
</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);
    }";
    settings.ClientSideEvents.CustomCommand = "function (s, e) { 
        if(e.commandName == 'ToggleResourcesVisibility') {
            showResources = !showResources;
            clientGantt.ShowResources(showResources);
        }
    }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()

Inheritance

ASPxClientEventArgs
ASPxClientCancelEventArgs
ASPxClientGanttContextMenuCustomizationEventArgs
See Also