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.

ASPxClientGanttContextMenuItem Class

A context menu item.

Declaration

declare class ASPxClientGanttContextMenuItem

Remarks

The ASPxGantt allows you to customize the built-in (ContextMenuCustomization) or create a custom context menu (ContextMenu).

The built-in context menu supports predefined and custom items. Use the CustomCommand event to handle clicks on custom items. You can call the Clear method to remove predefined items from the context menu.

<dx:ASPxGantt ID="Gantt" ClientInstanceName="clientGantt" >
    //...
    <ClientSideEvents
      ContextMenuCustomization="function(s, e) {
          ...
          // Creates an item
          var customItem = new ASPxClientGanttContextMenuItem();
          customItem.name = 'Item1';
          customItem.text = 'Item1';
          customItem.beginGroup = true;

          // Adds the item to the context menu items
          e.menuItems.Add(customItem);

          // Creates a subitem
          var customSubItem = new ASPxClientGanttContextMenuItem();
          customSubItem.name = 'Subitem1';
          customSubItem.text = 'Subitem1';

          // Adds the subitem to the parent item.
          customItem.GetSubItems().Add(customSubItem);
          ...
      }
      CustomCommand="function(s, e) {
          // Handles an item click
          if(e.commandName == 'Item1') {
              // your code
          }
      }
    />
</dx:ASPxGantt>

Examples

Online Demo

See Also