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

ParameterDefaultType
ActionColumnWidth42ddouble

Specifies action column width in pixels.
AddChildCommandAllowedtruebool

Determines whether creating child items is allowed.
AutoExpandViewfalsebool

Determines whether the active view range automatically expands to include all items.
ChildContentnullRenderFragment

Defines child content used to declare toolbar and views.
DatanullIEnumerable<TItem>

Specifies the data source displayed by the Gantt chart.
DateDateOnly.FromDateTime( DateTime.Today )DateOnly

Specifies the anchor date used by the selected view.
DateColumnWidth140ddouble

Specifies fallback date column width in pixels used when an auto-sized value cannot be calculated.
DeleteCommandAllowedtruebool

Determines whether deleting existing items is allowed.
DescriptionField"Description"string

Specifies the data field used for item descriptions.
Draggabletruebool

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.
Editablefalsebool

Determines whether item editing is enabled.
EditCommandAllowedtruebool

Determines whether editing existing items is allowed.
EndField"End"string

Specifies the data field used for item end dates.
FirstDayOfWeekDayOfWeek.MondayDayOfWeek

Specifies the first day of the week used for date calculations.
HeaderRowHeightDefaultHeaderRowHeightdouble

Specifies header row height in pixels.
HierarchicalDatafalsebool

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.
IncludeMilestonesInAutoExpandViewfalsebool

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.
KeyboardNavigationtruebool

Determines whether basic keyboard navigation is enabled for tree rows.
LocalizersnullGanttLocalizers

Provides custom localizers for Gantt UI text.
MilestonesnullIEnumerable<GanttMilestone>

Specifies milestone markers displayed on the Gantt timeline.
MilestoneTemplatenullRenderFragment<GanttMilestoneContext>

Defines template used to render milestone labels.
MinBarWidth14ddouble

Specifies minimum item bar width in pixels.
NewCommandAllowedtruebool

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.
Resizabletruebool

Determines whether timeline item bars can be resized by dragging their start and end edges.
SearchInputWidthDefaultSearchInputWidthdouble

Specifies search input width in pixels.
SearchModeMatchGanttSearchMode

Determines which related items are included in search results.
Possible values:MatchSubtree
SearchText—string

Specifies the search text used to filter tree rows.
SelectedRownullTItem

Specifies the currently selected tree row item.
SelectedViewWeekGanttView

Specifies the active Gantt view.
Possible values:DayWeekMonthYear
ShowToggleAllCommandstruebool

Determines whether toggle-all commands (expand/collapse all) are visible in the toolbar.
ShowToolbartruebool

Determines whether toolbar is rendered.
Sortabletruebool

Determines whether tree column sorting is enabled.
StartField"Start"string

Specifies the data field used for item start dates.
TaskItemTemplatenullRenderFragment<GanttItemContext<TItem>>

Defines template used to render timeline task content.
TimelineHeaderCellTemplatenullRenderFragment<GanttTimelineHeaderCellContext>

Defines template used to render timeline header cells.
TitleColumnWidth320ddouble

Specifies title column width in pixels.
TitleField"Title"string

Specifies the data field used for item titles.
TreeCommandCellTemplatenullRenderFragment<GanttTreeCommandCellContext<TItem>>

Defines template used to render command cell content.
TreeCommandHeaderTemplatenullRenderFragment<GanttTreeCommandHeaderContext<TItem>>

Defines template used to render command header content.
TreeIndentSize18ddouble

Specifies tree indentation size per level in pixels.
TreeToggleWidthDefaultTreeToggleWidthdouble

Specifies tree toggle placeholder width in pixels.
UseInternalEditingtruebool

Determines whether built-in modal editing and internal data mutation are used.

GanttColumn

ParameterDefaultType
CellsEditableOnEditCommandtruebool

Determines whether this column is editable during edit-item command.
CellsEditableOnNewCommandtruebool

Determines whether this column is editable during new-item command.
Displayabletruebool

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.
DisplayFormatProvidernullIFormatProvider

Specifies display format provider.
DisplayTemplatenullRenderFragment<GanttColumnDisplayContext<TItem>>

Defines custom display template.
Editabletruebool

Determines whether this column is editable in edit forms.
EditTemplatenullRenderFragment<GanttColumnEditContext<TItem>>

Defines custom edit template.
Expandablefalsebool

Determines whether this column should render tree expander.
Field—string

Field name bound to this column.
HeaderTemplatenullRenderFragment<GanttColumnHeaderContext<TItem>>

Defines custom header template.
Sortabletruebool

Determines whether this column can be sorted.
SortField—string

Specifies field used by sort operation. Defaults to Field.
TextAlignmentDefaultTextAlignment

Specifies text alignment for header and cell.
Possible values:DefaultStartEndCenterJustified
Title—string

Optional title shown in header.
Visibletruebool

Determines whether column is currently visible.
WidthnullIFluentSizing

Specifies width.

GanttCommandColumn

ParameterDefaultType
Displayabletruebool

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.
DisplayFormatProvidernullIFormatProvider

Specifies display format provider.
DisplayTemplatenullRenderFragment<GanttCommandColumnDisplayContext<TItem>>

Defines custom command display template.
EditTemplatenullRenderFragment<GanttColumnEditContext<TItem>>

Defines custom edit template.
Expandablefalsebool

Determines whether this column should render tree expander.
Field—string

Field name bound to this column.
HeaderTemplatenullRenderFragment<GanttColumnHeaderContext<TItem>>

Defines custom header template.
Sortabletruebool

Determines whether this column can be sorted.
SortField—string

Specifies field used by sort operation. Defaults to Field.
TextAlignmentDefaultTextAlignment

Specifies text alignment for header and cell.
Possible values:DefaultStartEndCenterJustified
Title—string

Optional title shown in header.
Visibletruebool

Determines whether column is currently visible.
WidthnullIFluentSizing

Specifies width.

GanttDayView

ParameterDefaultType
ItemTemplatenullRenderFragment<GanttItemContext<TItem>>

Template for rendering the timeline item bar.
LeadingSlots0int

Number of extra slots shown before the anchor period.
RowHeight44double

Height of each timeline row in pixels.
RowTemplatenullRenderFragment<GanttRowContext<TItem>>

Template for rendering the row cell.
TimelineCellWidth72double

Width of each timeline cell in pixels.
TrailingSlots0int

Number of extra slots shown after the anchor period.

GanttWeekView

ParameterDefaultType
FirstDayOfWeeknullDayOfWeek?

Specifies the first day of the week used for date calculations.
ItemTemplatenullRenderFragment<GanttItemContext<TItem>>

Template for rendering the timeline item bar.
LeadingSlots0int

Number of extra slots shown before the anchor period.
RowHeight44double

Height of each timeline row in pixels.
RowTemplatenullRenderFragment<GanttRowContext<TItem>>

Template for rendering the row cell.
TimelineCellWidth72double

Width of each timeline cell in pixels.
TrailingSlots0int

Number of extra slots shown after the anchor period.

GanttMonthView

ParameterDefaultType
ItemTemplatenullRenderFragment<GanttItemContext<TItem>>

Template for rendering the timeline item bar.
LeadingSlots0int

Number of extra slots shown before the anchor period.
RowHeight44double

Height of each timeline row in pixels.
RowTemplatenullRenderFragment<GanttRowContext<TItem>>

Template for rendering the row cell.
TimelineCellWidth72double

Width of each timeline cell in pixels.
TrailingSlots0int

Number of extra slots shown after the anchor period.

GanttYearView

ParameterDefaultType
FirstDayOfWeeknullDayOfWeek?

Specifies the first day of the week used when TimelineScale is Week.
ItemTemplatenullRenderFragment<GanttItemContext<TItem>>

Template for rendering the timeline item bar.
LeadingSlots0int

Number of extra slots shown before the anchor period.
RowHeight44double

Height of each timeline row in pixels.
RowTemplatenullRenderFragment<GanttRowContext<TItem>>

Template for rendering the row cell.
TimelineCellWidth72double

Width of each timeline cell in pixels.
TimelineScaleMonthGanttYearViewTimelineScale

Specifies the timeline scale used to render the year view columns.
Possible values:MonthWeek
TrailingSlots0int

Number of extra slots shown after the anchor period.

Events

Gantt

EventType
AddChildItemClickedEventCallback<GanttCommandContext<TItem>>

Notifies when the add-child command is triggered.
CommandAllowedFunc<GanttCommandContext<TItem>, bool>

Provides a callback that determines whether a command is allowed for a given item.
CustomFilterFunc<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.
DateChangedEventCallback<DateOnly>

Notifies when Date changes.
DeleteItemClickedEventCallback<GanttItemClickedEventArgs<TItem>>

Notifies when the delete action is triggered for an item.
EditItemClickedEventCallback<GanttItemClickedEventArgs<TItem>>

Notifies when the edit action is triggered for an item.
ItemClickedEventCallback<GanttItemClickedEventArgs<TItem>>

Notifies when a timeline item is clicked.
ItemInsertedEventCallback<GanttInsertedItem<TItem>>

Notifies after a new item is inserted.
ItemInsertingEventCallback<GanttCancellableItemChange<TItem>>

Notifies before a new item is inserted.
ItemRemovedEventCallback<GanttUpdatedItem<TItem>>

Notifies after an item is removed.
ItemRemovingEventCallback<GanttCancellableItemChange<TItem>>

Notifies before an item is removed.
ItemStylingAction<TItem, GanttItemStyling>

Defines styling applied to timeline bars for each item.
ItemUpdatedEventCallback<GanttUpdatedItem<TItem>>

Notifies after an item is updated.
ItemUpdatingEventCallback<GanttCancellableItemChange<TItem>>

Notifies before an existing item is updated.
MilestoneStylingAction<GanttMilestone, GanttMilestoneStyling>

Defines styling applied to timeline milestones.
NewIdCreatorFunc<object>

Provides a factory used to create new item identifiers.
NewItemClickedEventCallback<GanttCommandContext<TItem>>

Notifies when the new-item command is triggered.
NewItemCreatorFunc<TItem>

Provides a factory used to create new item instances.
ReadDataEventCallback<GanttReadDataEventArgs<TItem>>

Notifies when the Gantt requests data in manual read mode.
SearchTextChangedEventCallback<string>

Notifies when SearchText changes.
SelectedRowChangedEventCallback<TItem>

Notifies when SelectedRow changes.
SelectedViewChangedEventCallback<GanttView>

Notifies when SelectedView changes.

Methods

Gantt

MethodReturnParameters
AddChildTaskTItem parentItem

Creates a new child item for specified parent.
CollapseAllTask—

Collapses all nodes in the tree, including all nested child nodes.
DeleteTaskTItem item

Deletes specified item.
EditTaskTItem item

Puts chart in edit-item state for specified item.
ExpandAllTask—

Expands all nodes in the tree, including all nested child nodes.
GetStateTask<GanttState<TItem>>—

Gets current Gantt state.
LoadStateTaskGanttState<TItem> ganttState

Loads and applies Gantt state.
NavigateNextPeriodTask—

Navigates to the next period based on the selected view.
NavigatePreviousPeriodTask—

Navigates to the previous period based on the selected view.
NavigateTodayTask—

Navigates the chart to current date.
NewTask—

Creates a new item using configured new-item factory.
NewTaskTItem item

Creates a new top-level item.
NewTaskTItem item, TItem parentItem

Puts chart in new-item editing state.
ShowDayViewTask—

Switches to Day view.
ShowMonthViewTask—

Switches to Month view.
ShowWeekViewTask—

Switches to Week view.
ShowYearViewTask—

Switches to Year view.

GanttColumn

MethodReturnParameters
CellValueIsEditableboolGanttEditState editState

Gets whether the column value is editable for current edit state.
CanSortbool—

Returns true when column can be sorted.
FormatDisplayValuestringobject value

Gets formatted display text for this column.
GetSortFieldstring—

Gets field name to sort by.
GetSortValueobjectTItem item

Gets raw value used for sorting.
GetValueobjectTItem item

Gets raw value for this column.

GanttCommandColumn

MethodReturnParameters
CanSortbool—

Returns true when column can be sorted.
FormatDisplayValuestringobject value

Gets formatted display text for this column.
GetSortFieldstring—

Gets field name to sort by.
GetSortValueobjectTItem item

Gets raw value used for sorting.
GetValueobjectTItem item

Gets raw value for this column.