@@ -25,20 +25,7 @@ The following code illustrates how to bind the Task Details to the Gantt Control
2525
2626{% highlight xaml %}
2727
28- <syncfusion: GanttControl x: Name ="ganttControl"
29- ItemsSource="{Binding TaskDetails}">
30- < syncfusion:GanttControl.TaskAttributeMapping >
31- <syncfusion: TaskAttributeMapping TaskIdMapping="ID"
32- TaskNameMapping="Name"
33- StartDateMapping="StartDate"
34- ChildMapping="ChildCollection"
35- FinishDateMapping="EndDate"
36- DurationMapping="Duration"
37- ProgressMapping="Progress"/>
38- </syncfusion: GanttControl .TaskAttributeMapping>
39- < syncfusion:GanttControl.DataContext >
40- < local:ViewModel/ >
41- </syncfusion: GanttControl .DataContext>
28+ <syncfusion: GanttControl x: Name ="ganttControl">
4229</syncfusion: GanttControl >
4330
4431{% endhighlight %}
@@ -49,15 +36,17 @@ this.ganttControl.ItemsSource = new ViewModel().TaskDetails;
4936
5037// Task attribute mapping
5138TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
52- taskAttributeMapping.TaskIdMapping = "ID ";
53- taskAttributeMapping.TaskNameMapping = "Name ";
39+ taskAttributeMapping.TaskIdMapping = "TaskId ";
40+ taskAttributeMapping.TaskNameMapping = "TaskName ";
5441taskAttributeMapping.StartDateMapping = "StartDate";
55- taskAttributeMapping.ChildMapping = "ChildCollection ";
56- taskAttributeMapping.FinishDateMapping = "EndDate ";
42+ taskAttributeMapping.ChildMapping = "Child ";
43+ taskAttributeMapping.FinishDateMapping = "FinishDate ";
5744taskAttributeMapping.DurationMapping = "Duration";
5845taskAttributeMapping.ProgressMapping = "Progress";
5946this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
6047
48+ this.ganttControl.ItemsSource = new ViewModel().TaskDetails;
49+
6150{% endhighlight %}
6251
6352{% highlight c# tabtitle="ViewModel.cs" %}
0 commit comments