Skip to main content
All docs
V23.2

Critical Path

The GanttControl can highlight critical paths — sequences of dependent tasks that affect a project’s start or finish date. Use the CriticalPathHighlightMode option to specify how to highlight critical paths:

  • Single — The control highlights the longest sequence of dependent tasks that affect the project’s start or finish date.

    image

  • Multiple — The control highlights all sequences of dependent tasks that affect the project’s start or finish date.

    image

Run Demo: Code Examples - Critical Path.

Critical Tasks

Use a task’s IsCritical property to determine whether this task is on a critical path.

Critical Path Appearance

The default highlight color depends on the applied skin. You can use the Appearance collection’s CriticalPathTask and CriticalPathDependency properties to specify colors for tasks and dependency lines in critical paths.

using DevExpress.LookAndFeel;
using DevExpress.XtraGantt;

ganttControl.OptionsView.CriticalPathHighlightMode = CriticalPathHighlightMode.Single;
ganttControl.Appearance.CriticalPathTask.BackColor = DXSkinColors.FillColors.Danger;
ganttControl.Appearance.CriticalPathDependency.BackColor = DXSkinColors.FillColors.Danger;