Gantt charts for WPF: configurable to the max (or why DataTemplates rule)

DlhSoft
Gantt chart libraries
5 min readMar 4, 2020

Fast forward history

Back in 2006 we published our first Gantt chart component library, targeting WinForms. But when WPF came out, it was a great pleasure for us to rework everything and embrace the newer technology immediately: it offered extraordinary new features and very powerful tools (like styles and templates) that we have always dreamed about.

Called Gantt Chart Light Library (GCLL) it’s highly functional regardless; at this time the name just indicated that we had (and actually, still have) support the ~defunct Silverlight technology, and that we’ve redesigned everything with performance (and lightweight algorithms) in mind, that’s all.

Highly customizable Gantt, schedule and load charts, PERT methodology and network diagram components can all help you build many types of timeline-based applications like never before, be them classic project management tools, people and resource schedulers, process analyzing solutions, or simple, generic timelines displaying whatever items and dependencies you choose.

Gantt Chart Light Library: more info

The GanttChartDataGrid component comes with support for defining and easily displaying any “project” made of hierarchical (WBS) tasks and dependencies, with a lot of settings that the developer may configure upon integrating it into his or her app.

Custom appearance, working calendar and displayed days of week and hours of day (and any associated nonworking days and times), grid columns to be included, chart headers and scales to be used, and all custom appearance properties are all very easy to setup, as you can define everything by simply setting properties either at the component level itself or on the data items configured to be displayed, including brushes for virtually any of the drawn elements such as the standard and summary tasks, milestone diamonds, dependency arrow lines, etc.

Project management functionality is also available at your fingertips: optimizing work, leveling resources and, of course, auto-scheduling are all in. And so is Microsoft Project XML schema support for importing/exporting data with ease.

But the most important feature of all GCLL components (we’ll come to more of them in just a bit, below) is support for customizing item templates. The developer may choose to “reinvent” everything about tasks’ (and other elements’) look and feel, including bar shapes, assignments texts, dependency line styles, and even tool tips layout and structure.

You can even define new item level properties (e.g. a extra texts to be printed under the bars, lists of interruptions and marker icons to be drawn over the bar, or even other dates for showing secondary bars) that you can then bind from the custom XAML templates in any way that you could imagine.

WPF templates really rule!

Extra texts, interruptions, marker icons (left), dual bar items (right)

And this is not all. GCLL does also come with other great components. GanttChartView allows you to display a chart without an attached grid. Another important one is called ScheduleChartDataGrid (with ScheduleChartView counterpart as well): that allows you to display multiple bars per row and the end user can drag items vertically to (by first hovering the bottom area of their bars); and that is usually cool if you’re presenting a team schedule and tasks must be reassignable between members.

ScheduleChartDataGrid component

Schedule charts may be computed automatically from Gantt chart data too, and you adapt changes from a schedule chart (e.g. assignment updates performed using vertical drag and drop operations) back into the original Gantt chart source as well.

For example, if a task was assigned to “Resource 1” in GanttChartDataGrid using the drop down list from the “Assignments” grid column, and later that task’s assignment moves to “Resource 2” row in a Schedule chart, your code can collect and apply the changes into the source items’ AssignmentsContent properties with just a line of code.

LoadChartView and LoadChartDataGrid complete the list of timeline based components. They can display the allocation percentages of any or all assigned resources over time.

Schedule charts may be computed automatically from Gantt chart data too, and you adapt changes from a schedule chart back into the original Gantt chart source as well. For example, if a task was assigned to “Resource 1” in GanttChartDataGrid using the drop down list from the “Assignments” grid column, and later that task’s assignment moves to “Resource 2” row in a Schedule chart, your code can collect and apply the changes into the source items’ AssignmentsContent properties with just a line of code.

But even more interesting are NetworkDiagramView and PertChartView — later additions to our library. A PERT chart twists project data around and displays tasks as dependency lines, creating numbered (or otherwise labeled) events automatically in between. A network diagram is rather just displaying tasks as shapes in a canvas, with details such early/late start/finish and slack printed over.

You can create, of course, such a diagram (load chart, PERT chart, or network diagram) by passing data items directly, or using a Gantt chart source, of course. And again, all the components have customizable templates (DataTemplate properties defined) for virtually all elements they present.

LoadChartDataGrid (top-left), PertChartView (top-right) and NetworkDiagramView (bottom)

We have absolutely enjoyed developing them, and we hope you’ll enjoy integrating the components into your great Windows apps!

--

--