Bind to Data
- 2 minutes to read
You can bind the GanttControl to a collection of data items that represent tasks.
You should assign your data objects to the ItemsSource collection and specify mappings to bind task properties (StartDate, EndDate, etc.) to your data source fields.
Retrieve Tasks
The GanttControl can retrieve tasks from the following sources:
-
The GanttControl supports binding to hierarchical sources whose data items provide link to their children.
-
You can bind the GanttControl to a plain list of data items. To define the task hierarchy, use mappings (Id and ParentId).
Built-in data types
We provide built-in data objects (GanttTask, GanttPredecessorLink) for those who do not already have types for Gantt elements. You can assign a collection of these objects to the GanttControl.ItemsSource property without mapping properties to data source fields.
Refer to the getting started tutorial for more information on how to bind the GanttControl to a collection of built-in data objects.
Retrieve Task Relationships
You can store the task dependencies in any of the following ways:
- Task dependencies are stored in a separate collection: each of the collection elements stores Successor-Predecessor pair.
- Task dependencies are stored in the task objects: successor tasks store information about their predecessors.
Refer to Task Dependencies for more information.