GanttSettings Class

Contains the Gantt extension settings.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public class GanttSettings :
    SettingsBase
Public Class GanttSettings
    Inherits SettingsBase

Remarks

To declare the Gantt in a View, invoke the Gantt(GanttSettings) helper method. This method returns the Gantt extension that is implemented by the GanttExtension class.

To configure the Gantt extension, pass the GanttSettings object to the Gantt(GanttSettings) helper method as a parameter. The GanttSettings object contains all the Gantt extension settings.

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.CallbackRouteValues = new { Controller = "Gantt", Action = "FeaturesPartial" };
    settings.Width = Unit.Percentage(100);

    settings.KeyFieldName = "ID";
    settings.ParentFieldName = "ParentID";
    ...
    settings.Mappings.Task.Key = "ID";
    settings.Mappings.Task.ParentKey = "ParentID";
    settings.Mappings.Task.Title = "Subject";
    settings.Mappings.Task.Start = "StartDate";
    settings.Mappings.Task.End = "EndDate";
    settings.Mappings.Task.Progress = "PercentComplete";

    settings.Mappings.Dependency.Key = "ID";
    settings.Mappings.Dependency.PredecessorKey = "ParentID";
    settings.Mappings.Dependency.SuccessorKey = "DependentID";
    settings.Mappings.Dependency.DependencyType = "Type";

    settings.Mappings.Resource.Key = "ID";
    settings.Mappings.Resource.Name = "Name";

    settings.Mappings.ResourceAssignment.Key = "ID";
    settings.Mappings.ResourceAssignment.TaskKey = "TaskID";
    settings.Mappings.ResourceAssignment.ResourceKey = "ResourceID";

    settings.Columns.Add(c => {
        c.FieldName = "Subject";
        c.Width = 280;
    });
    settings.Columns.Add(c => {
        c.FieldName = "StartDate";
        c.Width = 100;
        c.DisplayFormat = "MM/dd/yyyy";
    });
    settings.Columns.Add(c => {
        c.FieldName = "EndDate";
        c.Width = 100;
        c.DisplayFormat = "MM/dd/yyyy";
    });
    ...
}).Bind(GanttDataProvider.Tasks, GanttDataProvider.Dependencies, GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments).GetHtml()

Online Demos

Inheritance

Object
SettingsBase
GanttSettings
See Also