Skip to main content
A newer version of this page is available. .
All docs
V20.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.

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

Tip

To see an example of a critical path, run the following demo: Code Examples - 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;