Skip to main content
All docs
V24.2

ASPxClientGanttContextMenuEventArgs Class

Contains data for the ContextMenu event.

Declaration

declare class ASPxClientGanttContextMenuEventArgs extends ASPxClientCancelEventArgs

Remarks

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

Web Forms:

<dx:ASPxGantt ID="Gantt" ClientInstanceName="clientGantt" >
    <ClientSideEvents 
        ContextMenu="function(s, e) { menu.ShowAtPos(e.htmlEvent.x,e.htmlEvent.y); }" 
        ContextMenuCustomization="function(s, e) { e.cancel = true; }"
    />
</dx:ASPxGantt>

<dx:ASPxPopupMenu runat="server" ID="popup" ClientInstanceName="menu">
    <Items>
        <dx:MenuItem Text="Item1" />
        <dx:MenuItem Text="Item2" />
    </Items>        
</dx:ASPxPopupMenu>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.ClientSideEvents.ContextMenuCustomization = "function (s, e) { e.cancel = true; }";
    settings.ClientSideEvents.ContextMenu = "function (s, e) { popup.ShowAtPos(e.htmlEvent.x,e.htmlEvent.y); }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()

@Html.DevExpress().PopupMenu(
    settings.Name = "popup";
    settings.Items.Add(item => {
        item.Text = "Item 1";
        item.Name = "Item 2";
    });
).GetHtml()

Inheritance

ASPxClientEventArgs
ASPxClientCancelEventArgs
ASPxClientGanttContextMenuEventArgs
See Also