Data Binding Basics
RadGanttView binds to any object that implements IList
, IListSource
or IBindingList
. This includes generic lists and BindingSource
for example. To make data binding work, minimally you must assign the DataSource property and the member properties explained below.
TaskDataMember: Set this to the filed that holds the collection of data that will be used to populate the tasks.
ChildMember*: Set this to the name of the field that will be used as Id of each record.
ParentMember*: Set this to the name of the field that will be used to build the hierarchy of tasks.
TitleMember*: Set this to the name of the filed that will be used as title for the tasks.
StartMember*: Set this to the name of the field that will be used as start for the tasks.
EndMember*: Set this to the name of the field that will be used as end for the tasks.
ProgressMember: Set this to the name of the field that will be used as progress of the tasks
LinkDataMember: Set this to the field name that holds the collection of data that will be used to populate the links.
LinkStartMember**: Set this to the name of the field that will be used as id for the start item of a link.
LinkEndMember** Set this to the name of the field that will be used as id for the end item of a link.
LinkTypeMember ** Set this to the name of the field that will be used to define the type of a link.
* - Marks the members that are the bare minimum to show a gantt with tasks. ** - Marks the members that are required to show links.
The following example demonstrates a sample data with all the code needed to bind and show this data in RadGanttView:
1. First we define the schema of the data.
2. USe the following snippet to populate with data.
3. Set all the aforementioned properties.
If you don't see the tasks, it is most probably because the graphical view is not scrolled to the tasks' date. Feel free to set the TimelineStart and TimelineEnd properties of the GanttViewElement.GraphicalViewElement.