Mappings
- 2 minutes to read
When you bind the GanttControl to a data source, you need to map the GanttNode properties to data source fields.
In real-world applications, the names of the database fields are usually fixed, and you cannot change them. Mappings are used to adjust the GanttControl data model to the existing data model.
Mapping | Data Type | Description |
---|---|---|
Name |
String | Maps to the Gantt |
Progress |
Double | Maps to the Gantt |
Start |
Date |
Maps to the Gantt |
Finish |
Date |
Maps to the Gantt |
Duration |
Time |
Maps to the Gantt |
Baseline |
Date |
Maps to the Gantt |
Baseline |
Date |
Maps to the Gantt |
Baseline |
Time |
Maps to the Gantt |
The code sample below demonstrates how to specify mappings.
<dxgn:GanttControl ItemsSource="{Binding Tasks}">
<dxgn:GanttControl.View>
<dxgn:GanttView
AutoExpandAllNodes="True"
TreeDerivationMode="Selfreference"
KeyFieldName="Id"
ParentFieldName="ParentId"
StartDateMapping="Start"
FinishDateMapping="Finish"
NameMapping="Name" />
</dxgn:GanttControl.View>
</dxgn:GanttControl>
Tip
You have no need to specify mappings when the Gantt
You can use the Mapping.Converter property to specify a value converter for your data:
<dxgn:GanttView.StartDateMapping>
<dxgn:Mapping Path="BaselineStartDate" Converter="{StaticResource ...}"/>
</dxgn:GanttView.StartDateMapping>