This topic explains how to configure tasks constraints using the xamGantt™ control.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The following table lists the configurable aspects when setting a task constraint in the xamGantt control. Additional details follow later in the topic.
The xamGantt control provides functionality for configuring tasks constraints and supports the constraint types available in Microsoft Project 2010.
The constraint types are following:
As Soon As Possible
The task starts on or after the project’s start date and the start date of any ancestor summary tasks that are manually scheduled.
As Late As Possible
The task finishes on or before the project’s finish date, task deadline (if specified), the finish date of any manually scheduled ancestor summary tasks, and the deadlines of any automatically scheduled ancestor summary tasks.
The following semi flexible and inflexible constraints depend on the ProjectSettings AlwaysHonorTaskConstraintDates property specifying the priority of the constraints over dependencies:
Must Start On
The task must/should start on the specified constraint date.
Must Finish On
The task must/should finish on the specified constraint date.
Start No Earlier Than
The task must/should start no earlier than the specified constraint date.
Start No Later Than
The task must/should start no later than the specified constraint date.
Finish No Earlier Than
The task must/should finish no earlier than the specified constraint date.
Finish No Later Than
The task must/should finish no later than the specified constraint date.
By default, for projects scheduled from start date, the tasks constraint type is As Soon As Possible. For projects scheduled from finish date, the tasks constraint type is As Late As Possible.
The constraint type of the manually scheduled tasks is not editable.
The following table maps the task constraint configuration to property settings.
The example code below demonstrates how to set an inflexible constraint type “Must Finish On” to a task:
In C#:
ProjectTask planniningTask = this.gantt.Project.RootTask.Tasks[0].Tasks[0];
planniningTask.ConstraintType = ProjectTaskConstraintType.MustFinishOn;
planniningTask.ConstraintDate = DateTime.Today.AddHours(8).ToUniversalTime();
In Visual Basic:
Dim planniningTask As ProjectTask = Me.gantt.Project.RootTask.Tasks(0).Tasks(0)
planniningTask.ConstraintType = ProjectTaskConstraintType.MustFinishOn
planniningTask.ConstraintDate = DateTime.Today.AddHours(8).ToUniversalTime()
The following topics provide additional information related to this topic.