Critical Path in UWP Gantt (SfGantt)

10 May 20211 minute to read

Critical path is a chain of linked critical tasks that defines the finish date of project. It can be highlighted by enabling the HighlightCriticalTasks property in SfGantt as demonstrated in the following code sample.

<gantt:SfGantt HighlightCriticalTasks="True"/>
SfGantt gantt = new SfGantt
{
    HighlightCriticalTasks = true
};

UWP Gantt chart with highlighted critical tasks

Customization

You can customize the color of critical path using the following properties:

NOTE

The same CriticalTaskBarBrush is applied to connector lines that connect two critical tasks.

<gantt:SfGantt HighlightCriticalTasks="True" CriticalTaskBarBrush="#ffdbe0" CriticalProgressBarBrush="Pink" />
SfGantt gantt = new SfGantt
    {
        HighlightCriticalTasks = true,
        CriticalTaskBarBrush = new SolidColorBrush(Color.FromArgb(255, 255, 219, 224)),
        CriticalProgressBarBrush = new SolidColorBrush(Colors.Pink)
    };

UWP Gantt chart with critical tasks highlighted with custom colors.

NOTE

By default, the HighlightCriticalTasks property is disabled.