Skip to main content

ASPxClientGanttCustomCommandEventArgs.commandName Property

Specifies the command name for a custom toolbar item.

Declaration

commandName: string

Property Value

Type Description
string

The command name.

Remarks

Run Demo: ASPxGantt - Toolbar Run Demo: MVCxGantt - Toolbar

Use the commandName property to specify a custom toolbar item’s command name.

Web Forms:

<dx:ASPxGantt ID="Gantt" ClientInstanceName="clientGantt" >
    <SettingsToolbar>
        <Items>
            <dx:GanttCustomToolbarItem Checked="True" Text="Show Resources" CommandName="Toggle" />
        </Items>
    </SettingsToolbar>
    <ClientSideEvents CustomCommand="function(s, e) {
        if(e.commandName == 'Toggle') {
            clientGantt.ShowResources(e.parameter);
        }
    }" />
</dx:ASPxGantt>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.SettingsToolbar.Items.AddCustomItem(i => {
        i.Checked = true;
        i.Text = "Show Resources";
        i.CommandName = "ShowResources";
    });    
    settings.ClientSideEvents.CustomCommand = "function (s, e) { 
        if(e.commandName == 'Toggle') {
            clientGantt.ShowResources(e.parameter);
        }      
    }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()

Examples

See Also