Back to Devexpress

GanttSettings.Mappings Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-ganttsettings-a72b9e22.md

latest2.6 KB
Original Source

GanttSettings.Mappings Property

Provides access to the object that contains a set of gantt’s properties mappings.

Namespace : DevExpress.Web.Mvc

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

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public GanttMappings Mappings { get; }
vb
Public ReadOnly Property Mappings As GanttMappings

Property Value

TypeDescription
GanttMappings

Provides functionality for mapping properties to appropriate data fields.

|

Remarks

Mappings specify what field in a data source corresponds to an object’s task, dependency or resource property.

Run Demo: MVCxGantt - Data Binding and Editing

cshtml
@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()

See Also

MVC Gantt - 'How To' Examples

MVC Gantt - Overview

GanttSettings Class

GanttSettings Members

DevExpress.Web.Mvc Namespace