Skip to main content

GanttMappings Class

A collection of mappings for the Gantt’s objects (tasks, dependencies, resources) to data fields.

Namespace: DevExpress.Web.ASPxGantt

Assembly: DevExpress.Web.ASPxGantt.v24.1.dll

NuGet Package: DevExpress.Web

#Declaration

public class GanttMappings :
    PropertiesBase

The following members return GanttMappings objects:

Library Related API Members
ASP.NET Web Forms Controls ASPxGantt.Mappings
ASP.NET MVC Extensions GanttSettings.Mappings

#Remarks

Run Demo: ASPxGantt - Data Binding Run Demo: MVCxGantt - Data Binding and Editing

Web Forms:

<dx:ASPxGantt ID="Gantt" runat="server" Width="100%" KeyFieldName="ID" ParentFieldName="ParentID" ...>
    <Task Key="ID" ParentKey="ParentID" Title="Subject" Start="StartDate" End="EndDate" Progress="PercentComplete" />
    <Dependency Key="ID" PredecessorKey="ParentID" SuccessorKey="DependentID" DependencyType="Type" />
    <Resource Key="ID" Name="Name" />
    <ResourceAssignment Key="ID" TaskKey="TaskID" ResourceKey="ResourceID" />
    ...
</dx:ASPxGantt>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.CallbackRouteValues = new { Controller = "Gantt", Action = "FeaturesPartial" };
    settings.Width = Unit.Percentage(100);
    ...
    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";
    ...
}).Bind(GanttDataProvider.Tasks, GanttDataProvider.Dependencies, GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments).GetHtml()

#Examples

#Implements

#Inheritance

See Also