Version

Configuring Tasks Constraints

Topic Overview

Purpose

This topic explains how to configure tasks constraints using the xamGantt™ control.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic describes how the xamGantt control can be bound to data via Project property.

In this topic

This topic contains the following sections:

Configuring Tasks Constrains Configuration Summary

Tasks constrains configuration summary chart

The following table lists the configurable aspects when setting a task constraint in the xamGantt control. Additional details follow later in the topic.

Configurable aspect Details Property

Configuring a task’s constraint type

Returns or sets the type of a task’s constraint.

Configuring a task’s constraint date

Returns or sets the task’s constraint date.

This property is not used when the constraint type is set to As Late As Possible or As Soon As Possible.

Configuring the priority in case of a conflict between task’s dependencies and constraints

Returns or sets a Boolean value indicating whether the task’s constraint is considered with higher priority than the task’s dependencies.

Setting a Task Constraint

Overview

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.

Property settings

The following table maps the task constraint configuration to property settings.

In order to: Use this property: And set it to:

Configure a task constraint type

Configure a task constraint date

Nullable<DateTime>

Example

The example code below demonstrates how to set an inflexible constraint type “Must Finish On” to a task:

Configuring Task Constraint 1.png

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()

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

The topics in this group explain the xamGantt ProjectTask class, its configurable aspects and the main features it provides.