Skip to main content
A newer version of this page is available. .

GanttControl.TreeListMappings Property

Provides access to options specified based on data source field names and tree list column object.

Namespace: DevExpress.XtraGantt

Assembly: DevExpress.XtraGantt.v19.2.dll

Declaration

[XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue)]
public TreeListMappings TreeListMappings { get; }

Property Value

Type Description
TreeListMappings

An object that contains options specified based on data source field names and tree list column object.’

Example

The code below shows how to initialize tree list and chart mappings.

GanttControl ganttControl = new GanttControl();
ganttControl.TreeListMappings.KeyFieldName = "Id";
ganttControl.TreeListMappings.ParentFieldName = "ParentId";
ganttControl.ChartMappings.TextFieldName = "Name";
ganttControl.ChartMappings.StartDateFieldName = "StartTime";
ganttControl.ChartMappings.FinishDateFieldName = "EndTime";
ganttControl.ChartMappings.ProgressFieldName = "Progress";
ganttControl.ChartMappings.PredecessorsFieldName = "PredecessorIDs";
ganttControl.DataSource = Task.GetData();

public class Task {
    public int Id { get; set; }
    public int ParentId { get; set; }
    //
    public string Name { get; set; }
    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
    public TimeSpan Duration { get; set; }
    public double Progress { get; set; }
    //
    public IReadOnlyList<int> PredecessorIDs {
        get; private set;
    }
}

Note

Run the Gantt Code Examples demo to see the complete example.

See Also