Resources objects
Often in your business layer, resources are probably represented as a list of instances of a complex type with various properties. Assign this list to the gantt as follows:
this.ganttControl.ItemsSource = new List<ResourceInfo>
{
new ResourceInfo{ ResourceID = 1, ResourceName = "Resource 1"},
new ResourceInfo{ ResourceID = 2, ResourceName = "Resource 2"},
new ResourceInfo{ ResourceID = 3, ResourceName = "Resource 3"}
};
You should then specify how a resource be identified in the model as well as how it should be identified in the UI. You can do this as follows:
<gantt:GanttControl x:Name="ganttControl" ResourceIDBinding="{Binding ResourceID}" ResourceNameBinding="{Binding ResourceName}"
.....................></gantt:GanttControl>
With this setup the resources will be represented in the model as a comma separated list of resource ids, as follows:
// Bound task instance where the Resources property specifies the resource assignments.
new TaskInfo { Name = "Task 1", ID = 4, StartTime = TimeComputingUtils.ToUtcKind(DateTime.Today), Effort = TimeSpan.Parse("08:00:00"), Resources = "1,2"},
To indicate to the GanttControl that the resource assignment information is in the property "Resources", setup this binding:
<gantt:GanttControl AssignedResourcesBinding="{Binding Resources}" .....................></gantt:GanttControl>
Due to the above ResourceNameBinding setup, the UI of the gantt will use the names of the resources rather than the id of the resources in the gantt table and chart as follows:
Resource names in gantt table.
Resource names in gantt chart.
This is illustrated in the ProjectGantt\Misc\Skeleton sample.
� RadiantQ 2009 - 2019. All Rights Reserved.