# Blazor Gantt Component Overview

The <a href = "https://www.telerik.com/blazor-ui/gantt" target="_blank">Blazor Gantt Chart component</a> allows you to easily illustrate a collection of tasks. The component consists of two areas:

* The [Gantt Tree](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/overview) hosts hierarchical information on the tasks, their start and end time.
* The [Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview) view illustrates the time-frame and the completeness of the task.

When the data collection is passed to the [Gantt Tree](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/overview), the component will automatically render the necessary elements in the [Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview).

## Creating Blazor Gantt

1. Add the `TelerikGantt` tag to a Razor file.

2. Set its `Data` attribute to the variable that will hold your collection of data.

3. Set the component dimensions through the `Width` and `Height` properties.

4. Under its `GanttViews` tag, set the desired [views](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/views).

5. Under its `GanttColumns` tag, set the desired [`GanttColumn`](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/columns/bound) instances whose `Field` property points to the name of the model field that you want to show.

6. Handle [`OnUpdate` and `OnDelete`](https://www.telerik.com/blazor-ui/documentation/components/gantt/events) events to react to items changes.

> caption Basic configuration of the Gantt Chart.

<demo metaUrl="client/gantt/overview/example-2/" height="740"></demo>

## Data Binding

To show data in a Telerik Gantt Chart, define [GanttColumn](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/columns/bound) instances - they take a model `Field` and expose settings to control the [visibility](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/columns/visible) of the column, the [format of the displayed data](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/columns/display-format), and the text alignment.

> tip The Telerik Blazor Gantt Chart is data source agnostic - you can use any database and service according to your project, you only need to get the collection of data models to the Gantt Chart in the view-model of the component hosting it.

The following list of resources provides examples for data binding a Gantt Chart in various scenarios:

* General information on how data binding works - [Gantt Chart Data Binding Overview](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/data-binding/overview).

* Binding to a self-referencing flat data source - [Bind the Gantt Chart to Flat Self-Referencing Data](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/data-binding/flat-data).

* Using hierarchical data source with item collections nested in each item - [Bind the Gantt Chart to Hierarchical Data](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/data-binding/hierarchical-data).

## Editing

The Gantt Chart can perform CRUD operations on its current data collection and exposes events that let you control the operations and transfer changes to the actual data source. The component allows you to edit both the tasks in the [TreeList](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/editing/overview) and their respective representation in the [Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/editing).

## Sorting

The Gantt Chart can sort data automatically. [Read more about the Blazor Gantt sorting](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/sorting).

## Filtering

The Gantt Chart can filter data automatically. [Read more about the Blazor Gantt filtering](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/filter/overview).

## Templates

The Blazor Gantt component exposes templates for customizing the [Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview) items rendering. [Read more about the Blazor Gantt templates](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/templates/overview).

## Toolbar

The Blazor Gantt component has a dedicated toolbar for defining user actions.

## Scrolling

When the total column width exceeds the width of the Gantt Chart, you will get a horizontal scrollbar.
When the height of the rows exceeds the height of the Gantt Chart, you will get a vertical scrollbar.

## Gantt Tree

The Gantt Tree is the left part of the Gantt Chart. The part to provide data through its data binding options. [Read more about the Blazor Gantt Tree](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/overview).

## Gantt Timeline

The Gantt Timeline provides visual representation of the Gantt records in a timeline view. The right part of the component. It is configured similarly to a [Scheduler Timeline](https://www.telerik.com/blazor-ui/documentation/components/scheduler/views/timeline) view. [Read more about the Blazor Gantt Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview).

## Gantt Dependencies

The Blazor Gantt allows defining dependencies, which are rendered in the [Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview) section of the component. A dependency represents a relation between two tasks. [Read more about the Blazor Gantt Dependencies](https://www.telerik.com/blazor-ui/documentation/components/gantt/dependencies/overview).

## Events

The Blazor Gantt fires CUD, expand/collapse, and TreeList pane width change events. Handle those events to respond to user actions. [Read more about the Blazor Gantt events](https://www.telerik.com/blazor-ui/documentation/components/gantt/events).

## Gantt Reference and Methods

To execute Gantt methods, obtain reference to the component instance via `@ref`.

The Gantt is a generic component. Its type depends on the type of its model and the type of its `Value`. In case you cannot provide either the `Value` or `Data` initially, you need to [set the corresponding types to the `TItem` and `TValue` parameters](https://www.telerik.com/blazor-ui/documentation/common-features/data-binding/overview#component-type).

The table below lists the Gantt methods. Also consult the [Gantt API](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikgantt-1).

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Method   | Description                                                                                                                  |
| -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `Rebind` | [Refreshes the component data](https://www.telerik.com/blazor-ui/documentation/components/gantt/refresh-data#rebind-method). |

<div class="skip-repl"></div>
<demo metaUrl="client/gantt/overview/example-1/" height="740"></demo>

## Next Steps

[Bind the Gantt to Data](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/data-binding/overview)

[Explore the Gantt Tree](https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/overview)

[Explore the Gantt Timeline](https://www.telerik.com/blazor-ui/documentation/components/gantt/timeline/overview)

[Handle the Gantt Events](https://www.telerik.com/blazor-ui/documentation/components/gantt/events)

## See Also

* [Live Demos: Gantt](https://demos.telerik.com/blazor-ui/gantt/overview)
* [Gantt API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikgantt-1)
