Resources as Simple Strings
The most simplest way to provide a set of resources that are available for assignment in a project is with an array of resource names as follows:
this.ganttControl1.ResourceItemsSource = new string[] { "Resource 1", "Resource 2" };
Your task object should then expose a string property that can hold the resource assignment information as a comma separated list of resource names, as follows:
// Bound task instance.
new TaskInfo { Name = "Task 6", ID = 13, StartTime = TimeComputingUtils.ToUtcKind(DateTime.Today) + TimeSpan.FromDays(2), Effort = TimeSpan.Parse("16:00:00"), Resources = "Resource 1, Resource 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>
The gantt will then read and write resource assignment information into this property of the bound object.
Partial Resource Assignments
A partial resource assignment is easily specified in the assignment string as follows:
this.ganttControl1.ResourceItemsSource = new string[] { "Resource 1[50%]", "Resource 2[75%]" };
This is illustrated in the "Common\TaskEditingDialog" sample.
See Assignments VS Task Duration for more info on how this affects the task's duration.
Hiding Resource text to the right of the bar
Normally, the assigned resources are shown to the right of the task bar in the gantt chart.

Resource names in gantt chart.
But, you can hide this if necessary as follows:
|
// In the page constructor this.ganttControl.TemplateApplied += new EventHandler(ganttControl_TemplateApplied); void ganttControl_TemplateApplied(object sender, EventArgs e) { this.ganttControl.GanttChart.ShowAssignedResourcesText = false; } |
� RadiantQ 2009 - 2019. All Rights Reserved.