Blazorise Gantt: API Reference
Explore the Blazorise Gantt API reference for tasks, columns, views, editing, timelines, and methods.
For examples and usage guidance, see the Gantt documentation.
API
Parameters
Gantt
| Parameter | Default | Type |
|---|---|---|
ActionColumnWidth | 42d | double |
Specifies action column width in pixels. | ||
AddChildCommandAllowed | true | bool |
Determines whether creating child items is allowed. | ||
AutoExpandView | false | bool |
Determines whether the active view range automatically expands to include all items. | ||
ChildContent | null | RenderFragment |
Defines child content used to declare toolbar and views. | ||
Data | null | IEnumerable<TItem> |
Specifies the data source displayed by the Gantt chart. | ||
Date | DateOnly.FromDateTime( DateTime.Today ) | DateOnly |
Specifies the anchor date used by the selected view. | ||
DateColumnWidth | 140d | double |
Specifies fallback date column width in pixels used when an auto-sized value cannot be calculated. | ||
DeleteCommandAllowed | true | bool |
Determines whether deleting existing items is allowed. | ||
DescriptionField | "Description" | string |
Specifies the data field used for item descriptions. | ||
Draggable | true | bool |
Determines whether timeline item bars can be dragged to move their start and end dates together. | ||
DurationField | "Duration" | string |
Specifies the data field used for item duration, in days. | ||
Editable | false | bool |
Determines whether item editing is enabled. | ||
EditCommandAllowed | true | bool |
Determines whether editing existing items is allowed. | ||
EndField | "End" | string |
Specifies the data field used for item end dates. | ||
FirstDayOfWeek | DayOfWeek.Monday | DayOfWeek |
Specifies the first day of the week used for date calculations. | ||
HeaderRowHeight | DefaultHeaderRowHeight | double |
Specifies header row height in pixels. | ||
HierarchicalData | false | bool |
Determines whether hierarchical data mode is forced when both parent-id and items mapping exist. | ||
IdField | "Id" | string |
Specifies the data field that contains each item's unique identifier. | ||
IncludeMilestonesInAutoExpandView | false | bool |
Determines whether AutoExpandView also includes milestone dates in the computed timeline range. | ||
ItemsField | "Items" | string |
Specifies the data field that contains child items for hierarchical data. | ||
KeyboardNavigation | true | bool |
Determines whether basic keyboard navigation is enabled for tree rows. | ||
Localizers | null | GanttLocalizers |
Provides custom localizers for Gantt UI text. | ||
Milestones | null | IEnumerable<GanttMilestone> |
Specifies milestone markers displayed on the Gantt timeline. | ||
MilestoneTemplate | null | RenderFragment<GanttMilestoneContext> |
Defines template used to render milestone labels. | ||
MinBarWidth | 14d | double |
Specifies minimum item bar width in pixels. | ||
NewCommandAllowed | true | bool |
Determines whether creating new top-level items is allowed. | ||
ParentIdField | "ParentId" | string |
Specifies the data field that contains each item's parent identifier. | ||
ProgressField | "Progress" | string |
Specifies the data field used for item progress values. | ||
Resizable | true | bool |
Determines whether timeline item bars can be resized by dragging their start and end edges. | ||
SearchInputWidth | DefaultSearchInputWidth | double |
Specifies search input width in pixels. | ||
SearchMode | Match | GanttSearchMode |
Determines which related items are included in search results. Possible values: MatchSubtree | ||
SearchText | — | string |
Specifies the search text used to filter tree rows. | ||
SelectedRow | null | TItem |
Specifies the currently selected tree row item. | ||
SelectedView | Week | GanttView |
Specifies the active Gantt view. Possible values: DayWeekMonthYear | ||
ShowToggleAllCommands | true | bool |
Determines whether toggle-all commands (expand/collapse all) are visible in the toolbar. | ||
ShowToolbar | true | bool |
Determines whether toolbar is rendered. | ||
Sortable | true | bool |
Determines whether tree column sorting is enabled. | ||
StartField | "Start" | string |
Specifies the data field used for item start dates. | ||
TaskItemTemplate | null | RenderFragment<GanttItemContext<TItem>> |
Defines template used to render timeline task content. | ||
TimelineHeaderCellTemplate | null | RenderFragment<GanttTimelineHeaderCellContext> |
Defines template used to render timeline header cells. | ||
TitleColumnWidth | 320d | double |
Specifies title column width in pixels. | ||
TitleField | "Title" | string |
Specifies the data field used for item titles. | ||
TreeCommandCellTemplate | null | RenderFragment<GanttTreeCommandCellContext<TItem>> |
Defines template used to render command cell content. | ||
TreeCommandHeaderTemplate | null | RenderFragment<GanttTreeCommandHeaderContext<TItem>> |
Defines template used to render command header content. | ||
TreeIndentSize | 18d | double |
Specifies tree indentation size per level in pixels. | ||
TreeToggleWidth | DefaultTreeToggleWidth | double |
Specifies tree toggle placeholder width in pixels. | ||
UseInternalEditing | true | bool |
Determines whether built-in modal editing and internal data mutation are used. | ||
GanttColumn
| Parameter | Default | Type |
|---|---|---|
CellsEditableOnEditCommand | true | bool |
Determines whether this column is editable during edit-item command. | ||
CellsEditableOnNewCommand | true | bool |
Determines whether this column is editable during new-item command. | ||
Displayable | true | bool |
Determines whether column can be shown in column picker. | ||
DisplayFormat | — | string |
Specifies a direct format specifier or composite format string for the default display text. | ||
DisplayFormatProvider | null | IFormatProvider |
Specifies display format provider. | ||
DisplayTemplate | null | RenderFragment<GanttColumnDisplayContext<TItem>> |
Defines custom display template. | ||
Editable | true | bool |
Determines whether this column is editable in edit forms. | ||
EditTemplate | null | RenderFragment<GanttColumnEditContext<TItem>> |
Defines custom edit template. | ||
Expandable | false | bool |
Determines whether this column should render tree expander. | ||
Field | — | string |
Field name bound to this column. | ||
HeaderTemplate | null | RenderFragment<GanttColumnHeaderContext<TItem>> |
Defines custom header template. | ||
Sortable | true | bool |
Determines whether this column can be sorted. | ||
SortField | — | string |
Specifies field used by sort operation. Defaults to Field. | ||
TextAlignment | Default | TextAlignment |
Specifies text alignment for header and cell. Possible values: DefaultStartEndCenterJustified | ||
Title | — | string |
Optional title shown in header. | ||
Visible | true | bool |
Determines whether column is currently visible. | ||
Width | null | IFluentSizing |
Specifies width. | ||
GanttCommandColumn
| Parameter | Default | Type |
|---|---|---|
Displayable | true | bool |
Determines whether column can be shown in column picker. | ||
DisplayFormat | — | string |
Specifies a direct format specifier or composite format string for the default display text. | ||
DisplayFormatProvider | null | IFormatProvider |
Specifies display format provider. | ||
DisplayTemplate | null | RenderFragment<GanttCommandColumnDisplayContext<TItem>> |
Defines custom command display template. | ||
EditTemplate | null | RenderFragment<GanttColumnEditContext<TItem>> |
Defines custom edit template. | ||
Expandable | false | bool |
Determines whether this column should render tree expander. | ||
Field | — | string |
Field name bound to this column. | ||
HeaderTemplate | null | RenderFragment<GanttColumnHeaderContext<TItem>> |
Defines custom header template. | ||
Sortable | true | bool |
Determines whether this column can be sorted. | ||
SortField | — | string |
Specifies field used by sort operation. Defaults to Field. | ||
TextAlignment | Default | TextAlignment |
Specifies text alignment for header and cell. Possible values: DefaultStartEndCenterJustified | ||
Title | — | string |
Optional title shown in header. | ||
Visible | true | bool |
Determines whether column is currently visible. | ||
Width | null | IFluentSizing |
Specifies width. | ||
GanttDayView
| Parameter | Default | Type |
|---|---|---|
ItemTemplate | null | RenderFragment<GanttItemContext<TItem>> |
Template for rendering the timeline item bar. | ||
LeadingSlots | 0 | int |
Number of extra slots shown before the anchor period. | ||
RowHeight | 44 | double |
Height of each timeline row in pixels. | ||
RowTemplate | null | RenderFragment<GanttRowContext<TItem>> |
Template for rendering the row cell. | ||
TimelineCellWidth | 72 | double |
Width of each timeline cell in pixels. | ||
TrailingSlots | 0 | int |
Number of extra slots shown after the anchor period. | ||
GanttWeekView
| Parameter | Default | Type |
|---|---|---|
FirstDayOfWeek | null | DayOfWeek? |
Specifies the first day of the week used for date calculations. | ||
ItemTemplate | null | RenderFragment<GanttItemContext<TItem>> |
Template for rendering the timeline item bar. | ||
LeadingSlots | 0 | int |
Number of extra slots shown before the anchor period. | ||
RowHeight | 44 | double |
Height of each timeline row in pixels. | ||
RowTemplate | null | RenderFragment<GanttRowContext<TItem>> |
Template for rendering the row cell. | ||
TimelineCellWidth | 72 | double |
Width of each timeline cell in pixels. | ||
TrailingSlots | 0 | int |
Number of extra slots shown after the anchor period. | ||
GanttMonthView
| Parameter | Default | Type |
|---|---|---|
ItemTemplate | null | RenderFragment<GanttItemContext<TItem>> |
Template for rendering the timeline item bar. | ||
LeadingSlots | 0 | int |
Number of extra slots shown before the anchor period. | ||
RowHeight | 44 | double |
Height of each timeline row in pixels. | ||
RowTemplate | null | RenderFragment<GanttRowContext<TItem>> |
Template for rendering the row cell. | ||
TimelineCellWidth | 72 | double |
Width of each timeline cell in pixels. | ||
TrailingSlots | 0 | int |
Number of extra slots shown after the anchor period. | ||
GanttYearView
| Parameter | Default | Type |
|---|---|---|
FirstDayOfWeek | null | DayOfWeek? |
Specifies the first day of the week used when TimelineScale is Week. | ||
ItemTemplate | null | RenderFragment<GanttItemContext<TItem>> |
Template for rendering the timeline item bar. | ||
LeadingSlots | 0 | int |
Number of extra slots shown before the anchor period. | ||
RowHeight | 44 | double |
Height of each timeline row in pixels. | ||
RowTemplate | null | RenderFragment<GanttRowContext<TItem>> |
Template for rendering the row cell. | ||
TimelineCellWidth | 72 | double |
Width of each timeline cell in pixels. | ||
TimelineScale | Month | GanttYearViewTimelineScale |
Specifies the timeline scale used to render the year view columns. Possible values: MonthWeek | ||
TrailingSlots | 0 | int |
Number of extra slots shown after the anchor period. | ||
Events
Gantt
| Event | Type |
|---|---|
AddChildItemClicked | EventCallback<GanttCommandContext<TItem>> |
Notifies when the add-child command is triggered. | |
CommandAllowed | Func<GanttCommandContext<TItem>, bool> |
Provides a callback that determines whether a command is allowed for a given item. | |
CustomFilter | Func<TItem, string, bool> |
Gets or sets the custom item filter. Replaces title and description matching. Receives the item and trimmed search text, which may be empty. | |
DateChanged | EventCallback<DateOnly> |
Notifies when Date changes. | |
DeleteItemClicked | EventCallback<GanttItemClickedEventArgs<TItem>> |
Notifies when the delete action is triggered for an item. | |
EditItemClicked | EventCallback<GanttItemClickedEventArgs<TItem>> |
Notifies when the edit action is triggered for an item. | |
ItemClicked | EventCallback<GanttItemClickedEventArgs<TItem>> |
Notifies when a timeline item is clicked. | |
ItemInserted | EventCallback<GanttInsertedItem<TItem>> |
Notifies after a new item is inserted. | |
ItemInserting | EventCallback<GanttCancellableItemChange<TItem>> |
Notifies before a new item is inserted. | |
ItemRemoved | EventCallback<GanttUpdatedItem<TItem>> |
Notifies after an item is removed. | |
ItemRemoving | EventCallback<GanttCancellableItemChange<TItem>> |
Notifies before an item is removed. | |
ItemStyling | Action<TItem, GanttItemStyling> |
Defines styling applied to timeline bars for each item. | |
ItemUpdated | EventCallback<GanttUpdatedItem<TItem>> |
Notifies after an item is updated. | |
ItemUpdating | EventCallback<GanttCancellableItemChange<TItem>> |
Notifies before an existing item is updated. | |
MilestoneStyling | Action<GanttMilestone, GanttMilestoneStyling> |
Defines styling applied to timeline milestones. | |
NewIdCreator | Func<object> |
Provides a factory used to create new item identifiers. | |
NewItemClicked | EventCallback<GanttCommandContext<TItem>> |
Notifies when the new-item command is triggered. | |
NewItemCreator | Func<TItem> |
Provides a factory used to create new item instances. | |
ReadData | EventCallback<GanttReadDataEventArgs<TItem>> |
Notifies when the Gantt requests data in manual read mode. | |
SearchTextChanged | EventCallback<string> |
Notifies when SearchText changes. | |
SelectedRowChanged | EventCallback<TItem> |
Notifies when SelectedRow changes. | |
SelectedViewChanged | EventCallback<GanttView> |
Notifies when SelectedView changes. | |
Methods
Gantt
| Method | Return | Parameters |
|---|---|---|
AddChild | Task | TItem parentItem |
Creates a new child item for specified parent.
| ||
CollapseAll | Task | — |
Collapses all nodes in the tree, including all nested child nodes.
| ||
Delete | Task | TItem item |
Deletes specified item.
| ||
Edit | Task | TItem item |
Puts chart in edit-item state for specified item.
| ||
ExpandAll | Task | — |
Expands all nodes in the tree, including all nested child nodes.
| ||
GetState | Task<GanttState<TItem>> | — |
Gets current Gantt state.
| ||
LoadState | Task | GanttState<TItem> ganttState |
Loads and applies Gantt state.
| ||
NavigateNextPeriod | Task | — |
Navigates to the next period based on the selected view.
| ||
NavigatePreviousPeriod | Task | — |
Navigates to the previous period based on the selected view.
| ||
NavigateToday | Task | — |
Navigates the chart to current date.
| ||
New | Task | — |
Creates a new item using configured new-item factory.
| ||
New | Task | TItem item |
Creates a new top-level item.
| ||
New | Task | TItem item, TItem parentItem |
Puts chart in new-item editing state.
| ||
ShowDayView | Task | — |
Switches to Day view.
| ||
ShowMonthView | Task | — |
Switches to Month view.
| ||
ShowWeekView | Task | — |
Switches to Week view.
| ||
ShowYearView | Task | — |
Switches to Year view.
| ||
GanttColumn
| Method | Return | Parameters |
|---|---|---|
CellValueIsEditable | bool | GanttEditState editState |
Gets whether the column value is editable for current edit state.
| ||
CanSort | bool | — |
Returns true when column can be sorted.
| ||
FormatDisplayValue | string | object value |
Gets formatted display text for this column.
| ||
GetSortField | string | — |
Gets field name to sort by.
| ||
GetSortValue | object | TItem item |
Gets raw value used for sorting.
| ||
GetValue | object | TItem item |
Gets raw value for this column.
| ||
GanttCommandColumn
| Method | Return | Parameters |
|---|---|---|
CanSort | bool | — |
Returns true when column can be sorted.
| ||
FormatDisplayValue | string | object value |
Gets formatted display text for this column.
| ||
GetSortField | string | — |
Gets field name to sort by.
| ||
GetSortValue | object | TItem item |
Gets raw value used for sorting.
| ||
GetValue | object | TItem item |
Gets raw value for this column.
| ||