Gantt chart

GanttControl

Plan a project as a task list with a timeline users edit by dragging bars.

Overview

GanttControl is a Blazor Gantt chart: a task list beside a timeline, with nested tasks, predecessor arrows and progress on each bar. Use it for project plans: users drag bars to move or resize tasks, a task cannot start before its predecessor ends, and TaskChanging lets your code refuse a change. Changes arrive through TasksChanged as copies, so the objects you passed in are never edited.

Examples

#Project schedule

Drag a bar to move a task, or its end to resize it; use Add, Edit and Delete and switch the timescale; rule-breaking changes are refused with a message.

TaskStartEnd
Nov 2Dec 2
−Design11/2/202611/27/2026
Wireframes11/2/202611/13/2026
Visual design11/13/202611/27/2026
−Build11/27/202612/11/2026
Front end11/27/202612/8/2026
API11/27/202612/11/2026
Content11/9/202611/30/2026
Test12/11/202612/18/2026
Launch12/18/202612/26/2026

9 tasks, 11/2/2026 to 12/26/2026; 1 complete.

#Read-only timeline with a task template

Switch the timescale between Day, Week, Month and Year on a read-only plan whose TaskTemplate adds each task's progress; the Gantt's own toolbar reports changes through ViewChanged.

TaskStartEnd
Nov 2Dec 2
−Design 90%11/2/202611/27/2026
Wireframes 100%11/2/202611/13/2026
Visual design 80%11/13/202611/27/2026
−Build 35%11/27/202612/11/2026
Front end 40%11/27/202612/8/2026
API 30%11/27/202612/11/2026
Content 60%11/9/202611/30/2026
Test 0%12/11/202612/18/2026
Launch 0%12/18/202612/26/2026

View: Month.

#Vetoing a change

TaskChanging locks finished tasks and refuses every delete: drag Wireframes a day left, or select Launch and press Delete, and the line under the chart reports the refusal.

TaskStartEnd
Nov 2Dec 2
−Design11/2/202611/27/2026
Wireframes11/2/202611/13/2026
Visual design11/13/202611/27/2026
−Build11/27/202612/11/2026
Front end11/27/202612/8/2026
API11/27/202612/11/2026
Content11/9/202611/30/2026
Test12/11/202612/18/2026
Launch12/18/202612/26/2026

No changes yet.

Documentation

ParameterTypeDefaultDescription
TasksIReadOnlyList<GanttTask>Array.Empty<GanttTask>()The schedule. Read again only when a different list instance arrives: the control clones the tasks, so changes made to the objects in place are not seen. Checked on arrival against every rule except the dependency rule.
AllowEditingbooltrueFalse disables Add, Edit and Delete, the dialog, double-click and the drag handles. Expand all, Collapse all and the timescale stay.
AllowTaskDragbooltrueFalse removes the end handles and ignores a drag on a bar; the dialog still edits.
EnforceDependenciesbooltrueTrue refuses a change after which any task starts before one of its predecessors ends. The whole schedule is checked on every change, so a list that already breaks the rule refuses every edit until the conflict is repaired.
ViewGanttViewGanttView.WeekTimescale: Day, Week, Month or Year at 72, 32, 8 or 2 pixels per day, with an axis label every 1, 7, 30 or 90 days. The toolbar's dropdown changes it and raises ViewChanged.
Heightstring"450px"Height of the task grid; the toolbar sits above it.
TaskTemplateRenderFragment<GanttTask>?nullReplaces the text in the Task column. The row still opens the editor on double-click.

CssClass, Style, Id, Visible, Enabled and AdditionalAttributes come from FlexControlBase and apply to the root div; Enabled="false" disables editing the same way AllowEditing does.

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.