TelerikGantt<TItem>
A component that lets you visualize and manage project tasks with a TreeList and a timeline. Supports multiple views (Day/Week/Month/Year), task dependencies, inline/popup/in-cell editing, sorting, filtering (row/menu), column resize/reorder, tooltips, keyboard navigation, and a customizable toolbar. Provides state get/set APIs and events for add/edit/create/update/delete, expand/collapse, view changes, and overall state changes. Children: GanttViews, GanttColumns, GanttSettings, GanttDependenciesSettings.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Type Parameters:
TItem
Syntax:
public class TelerikGantt<TItem> : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikGantt<TItem>
Implements:
Inherited Members
Constructors
public TelerikGantt()
Methods
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
public override void Dispose()
Overrides:
GetState()
GanttState<TItem>
Gets the current state of the Gantt. Includes sorting, filtering, edit items, column state, etc.
public GanttState<TItem> GetState()
GanttState<TItem>
Instance of a GanttState<TItem> class that contains all data.
protected virtual Dictionary<string, object> GetWidgetOptions()
Processes the available data with applied all data operations. Useful in scenarios where the data might change from an outside source.
public void Rebind()
protected void RefreshTimeLine()
protected void RefreshTreeList()
Sets the state of the Gantt. Includes sorting, filtering, edit items, column state, etc.
Properties
public bool AutoGenerateColumns { get; }
Defines whether the columns of the TreeList can be reordered.
[Parameter]
public bool ColumnReorderable { get; set; }
Defines whether the columns of the TreeList can be resized.
[Parameter]
public bool ColumnResizable { get; set; }
protected TreeListEditMode ConvertedTreeListEditMode { get; }
Data
IEnumerable<TItem>
Defines the data source of the Gantt.
[Parameter]
public IEnumerable<TItem> Data { get; set; }
public GanttDependencies DependenciesSettings { get; set; }
DependencyElements
List<DependencyElement>
public List<DependencyElement> DependencyElements { get; set; }
Defines if a loading indicator displays in the TreeList during long-running operations. The default value is true. The setting has no effect on initial data load.
[Parameter]
public bool EnableLoaderContainer { get; set; }
Enables WebMCP tool registration for this Gantt. When true, Gantt operations are exposed as tools discoverable by AI models through the browser.
Configure tool names and overrides via GanttWebMcpSettings inside GanttSettings.
[Parameter]
public bool EnableWebMcpTools { get; set; }
Defines the EndField of the Data. Default value: "End".
[Parameter]
public string EndField { get; set; }
FilterMenuType
FilterMenuType
Defines the filter menu type when "FilterMode" is set to "FilterMenu".
[Parameter]
public FilterMenuType FilterMenuType { get; set; }
Defines the Filter Mode of the Component.
[Parameter]
public GanttFilterMode FilterMode { get; set; }
Time in ms between the last typed symbol and the firing of the internal filter oninput event. Default is 150ms.
[Parameter]
public int FilterRowDebounceDelay { get; set; }
Defines the container for the TreeList columns. Children: GanttColumn tags.
[Parameter]
public RenderFragment GanttColumns { get; set; }
Defines the container for the Gantt Settings such as GanttPopupEditSettings. Children: GanttPopupEditSettings tag.
[Parameter]
public RenderFragment GanttSettings { get; set; }
Defines the custom toolbar template for the Gantt. Children: allows arbitrary content.
[Parameter]
public RenderFragment GanttToolBarTemplate { get; set; }
Defines the container for the Gantt views. Children: GanttDayView, GanttWeekView, GanttMonthView, GanttYearView.
[Parameter]
public RenderFragment GanttViews { get; set; }
Defines the HasChildren DataField of the DataSource.
[Parameter]
public string HasChildrenField { get; set; }
Defines the Id DataField of the DataSource.
[Parameter]
public string IdField { get; set; }
Defines the Items DataField of the DataSource that contains the child nodes.
[Parameter]
public string ItemsField { get; set; }
Defines whether the Component is navigable using the keyboard.
[Parameter]
public bool Navigable { get; set; }
The position at which a new data item is inserted in the Gantt's tree list - top or bottom. Default value is Top.
[Parameter]
public GanttTreeListNewRowPosition NewRowPosition { get; set; }
Fires when an item is about to be inserted.
[Parameter]
public EventCallback<GanttAddEventArgs> OnAdd { get; set; }
Fires when a row is collapsed.
[Parameter]
public EventCallback<GanttCollapseEventArgs> OnCollapse { get; set; }
Fires when an item is created.
[Parameter]
public EventCallback<GanttCreateEventArgs> OnCreate { get; set; }
Fires when a task is deleted.
[Parameter]
public EventCallback<GanttDeleteEventArgs> OnDelete { get; set; }
Fires when an item is about to be edited.
[Parameter]
public EventCallback<GanttEditEventArgs> OnEdit { get; set; }
Fires when a row is expanded.
[Parameter]
public EventCallback<GanttExpandEventArgs> OnExpand { get; set; }
Fires on user interaction that causes changes in the GanttState<TItem>.
[Parameter]
public EventCallback<GanttStateEventArgs<TItem>> OnStateChanged { get; set; }
Invoked when the Gantt is initializing for the first time and before its initial render. Hook to this event if you would like to provide an initial state through the State field of its event arguments.
[Parameter]
public EventCallback<GanttStateEventArgs<TItem>> OnStateInit { get; set; }
Fires when the Update command is executed.
[Parameter]
public EventCallback<GanttUpdateEventArgs> OnUpdate { get; set; }
Defines the ParentId DataField of the DataSource.
[Parameter]
public string ParentIdField { get; set; }
Defines the PercentCompleteField of the Data. Default value: "PercentComplete".
[Parameter]
public string PercentCompleteField { get; set; }
Determines what the Gantt range calculation is based on.
[Parameter]
public GanttRangeSnapTo RangeSnapTo { get; set; }
Defines the height of each row in the Gantt. Accepts a number and is applied as pixels.
[Parameter]
public decimal RowHeight { get; set; }
SelectedView
IGanttView
public IGanttView SelectedView { get; }
Specifies if header cells will render a button to display a column menu. Use ShowColumnMenu to disable the menu at column level.
[Parameter]
public bool ShowColumnMenu { get; set; }
Defines whether a task tooltip is visible for the tasks in the Timeline.
[Parameter]
public bool ShowTooltip { get; set; }
Defines whether the Component is sortable.
[Parameter]
public bool Sortable { get; set; }
Defines the StartField of the Data. Default value: "Start".
[Parameter]
public string StartField { get; set; }
TaskElements
List<TaskElement>
public List<TaskElement> TaskElements { get; set; }
TaskTemplate
RenderFragment<TItem>
Defines the template that will be used to render items in the timeline view. Children: allows arbitrary content.
[Parameter]
public RenderFragment<TItem> TaskTemplate { get; set; }
Defines the TitleField of the Data. Default value: "Title".
[Parameter]
public string TitleField { get; set; }
Specifies the template for the content of the task tooltip. The @context of the template contains the model associated with the item.
[Parameter]
public RenderFragment<object> TooltipTemplate { get; set; }
protected TreeListFilterMode TreeListFilterMode { get; }
protected TreeListNewRowPosition TreeListNewRowPosition { get; }
Specifies the width of the TreeList panel in pixels or percentages.
[Parameter]
public string TreeListWidth { get; set; }
Triggers when TreeList width has changed.
[Parameter]
public EventCallback<string> TreeListWidthChanged { get; set; }
The currently selected view of the Gantt. Determines the layout of the timeline view.
[Parameter]
public GanttView View { get; set; }
The handler that will be called when the currently selected view is changed.
[Parameter]
public EventCallback<GanttView> ViewChanged { get; set; }