Context Menu

Default Context Menu

The default context menu contains the following options.

  • Task Details
  • Add New Task
  • Indent
  • Outdent
  • Delete

The following code example shows you how to enable the default context menu in Gantt control.

  • html
  • <ej:Gantt ID="GanttContainer" runat="server" EnableContextMenu="true">

    The following screenshot shows the Default Context Menu in Gantt control.

    Default Context Menu

    Custom Context Menu

    You can add custom context menu option in Gantt control. The following code example shows you how to add the custom context menu option in Gantt control.

    <script type="text/javascript">
    
                function contextMenuOpen(args) {
    
                    args.contextMenuItems.push(
    
                        {
    
                            headerText: "ExpandAll",
    
                            iconPath: "url(../images/Expand All.png)",
    
                            evenHandler: function () {
    
                                //event handler for custom menu items
    
                            }
    
                        });
    
                }
    
              </script>
    <ej:Gantt ID="GanttContainer" runat="server" EnableContextMenu="true" ContextMenuOpen="contextMenuOpen">

    The screenshot of the Custom Context Menu items in Gantt control is as follows.

    C:/Users/Rajasekar/Desktop/IMG_17062014_121224.png

    Custom Context Menu