This topic explains how you set task progress using the xamGantt™ control.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
You specify the project task’s progress as a percentage of work completed.
To specify the progress, use the ProjectTask PercentComplete property and set it to a decimal type in the range from 0 to 100.
The control displays the task’s progress in both the grid and chart xamGantt section.
In the grid section, the task progress appears in the % Complete column. If the task work is 100% completed, a check mark notification icon appears in the grid Indicators column.
In the chart section, the progress appears as a progress line on the taskbar where the end of the bar represents the CompleteThrough date for the task.
The following table maps the desired configuration to property settings.
The example below demonstrates how to set a task’s progress to 50%:
In C#:
XamGantt gantt = new XamGantt();
Project project = new Project();
ProjectTask task = new ProjectTask();
task.TaskName = "Task in progress";
task.IsManual = false;
// Set task progress
task.PercentComplete = 50;
task.Duration = TimeSpan.FromHours(16);
task.Start = DateTime.Today.ToUniversalTime();
project.RootTask.Tasks.Add(task);
gantt.Project = project;
In Visual Basic:
Dim gantt As New XamGantt()
Dim project As New Project()
Dim task As New ProjectTask()
task.TaskName = "Task in progress"
task.IsManual = False
' Set task progress
task.PercentComplete = 50
task.Duration = TimeSpan.FromHours(16)
task.Start = DateTime.Today.ToUniversalTime()
project.RootTask.Tasks.Add(task)
gantt.Project = project
The following topics provide additional information related to this topic.