Back to Devexpress

GanttToolbarSettings Class

aspnet-devexpress-dot-web-dot-aspxgantt-471f97e0.md

latest5.9 KB
Original Source

GanttToolbarSettings Class

Contains toolbar settings.

Namespace : DevExpress.Web.ASPxGantt

Assembly : DevExpress.Web.ASPxGantt.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class GanttToolbarSettings :
    GanttSettingsBase
vb
Public Class GanttToolbarSettings
    Inherits GanttSettingsBase

The following members return GanttToolbarSettings objects:

LibraryRelated API Members
ASP.NET Web Forms ControlsASPxGantt.SettingsToolbar
ASP.NET MVC ExtensionsGanttSettings.SettingsToolbar

Remarks

The ASPxGantt control allows you to display the most frequently used commands in the built-in toolbar.

Run Demo: (Web Forms) Gantt Toolbar

Run Demo: (MVC) Gantt Toolbar

The toolbar has a set of predefined items and supports custom items. Use the Items collection to access toolbar items.

Available toolbar item types:

|

Toolbar Item Type

|

Description

| | --- | --- | |

GanttAddTaskToolbarItem

|

A toolbar item that adds a task.

| |

GanttCollapseAllToolbarItem

|

A toolbar item that collapses all tasks.

| |

GanttExpandAllToolbarItem

|

A toolbar item that expands all tasks.

| |

GanttFullScreenToolbarItem

|

A toolbar item that switches the control to full screen mode.

| |

GanttRedoToolbarItem

|

A toolbar item that repeats the undone action.

| |

GanttRemoveTaskToolbarItem

|

A toolbar item that removes a task.

| |

GanttUndoToolbarItem

|

A toolbar item that reverses an action.

| |

GanttZoomInToolbarItem

|

A toolbar item that zooms in.

| |

GanttCustomToolbarItem

|

A custom toolbar item.

| |

GanttZoomOutToolbarItem

|

A toolbar item that zooms out.

|

Create a Standard Toolbar Item

Create any of supported standard toolbar items, specify its Text property, and add this toolbar item to the Items collection.

aspx
<dx:ASPxGantt ID="Gantt" runat="server"...>
    ...
    <SettingsToolbar>
        <Items>
            <dx:GanttZoomInToolbarItem Text="Zoom In" />
            <dx:GanttZoomOutToolbarItem Text="Zoom Out" />
        </Items>
    </SettingsToolbar>
</dx:ASPxGantt>

Create a Custom Toolbar Item

Create a GanttCustomToolbarItem object, specify its Text and CommandName properties, and add this toolbar item to the Items collection. To handle the toolbar item click, handle the CustomCommand event.

aspx
<dx:ASPxGantt ID="Gantt">
    <SettingsToolbar>
        <Items>
            <dx:GanttCustomToolbarItem Text="About" CommandName="About" />
        </Items>
    </SettingsToolbar>
    <ClientSideEvents CustomCommand="CustomCommand" />
    ...
</dx:ASPxGantt>
javascript
function CustomCommand(s, e) {
    if (e.commandName == "About")
        alert('Sample message');
}

Show and Hide Toolbar

Set the Visible property to true to hide the toolbar.

aspx
<dx:ASPxGantt ID="Gantt" runat="server"...>
    ...
    <SettingsToolbar Visible="false" />
</dx:ASPxGantt>

Change Toolbar Alignment

Set the Alignment property to one of the GanttToolbarAlignment enumeration values to change the toolbar alignment.

aspx
<dx:ASPxGantt ID="Gantt" runat="server"...>
    ...
    <SettingsToolbar Alignment="Right" />
</dx:ASPxGantt>

Implements

IStateManager

Inheritance

Object StateManager PropertiesBase GanttSettingsBase GanttToolbarSettings

See Also

GanttToolbarSettings Members

ASPxGantt - 'How To' Examples

DevExpress.Web.ASPxGantt Namespace