Back to Devexpress

Gantt

aspnetmvc-401321-components-gantt.md

latest3.7 KB
Original Source

Gantt

  • Oct 07, 2021
  • 3 minutes to read

The Gantt (GanttExtension) visualizes the task flow.

Run Demo: Gantt Extension Demos

Features

Add a Gantt to a View

Use the Gantt(GanttSettings) helper method to add the Gantt (GanttExtension) extension to a view. The Gantt(GanttSettings) method’s parameter provides access to the Gantt’s settings (GanttSettings).

View code (Razor):

csharp
@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.SettingsGanttView.ViewType = GanttViewType.Weeks;

    settings.Mappings.Task.Key = "ID";
    settings.Mappings.Task.ParentKey = "ParentID";
    //...

    settings.SettingsTaskList.Columns.Add(
        new GanttTextColumn() { 
            FieldName = "Subject", 
            Caption = "Title", 
            Width = Unit.Pixel(360) 
        }
    );
    //...
}).Bind(GanttDataProvider.Tasks, GanttDataProvider.Dependencies, GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments).GetHtml()

Note

The Partial View should contain only the extension’s code.

Visual Elements