RadTimeline fully supports binding to various data sources on the server-side, such as
- Array
- IEnumerable
- DataTable
- DataSet
- DataView
This demo demonstrates how to bind RadTimeline to an IEnumerable, at runtime. In the Page_Load
event handler, you can create and fill an IEnumerable collection of custom objects, then bind it to the RadTimeline.
The DataBind() method should be called after setting the DataSource property.
Below are the databinding properties and methods you can use when binding Timeline:
- DataSource property - set to an instance of the data source.
- DataSourceID property - set to the ID of the data source.
-
DataMember property - if the data source is a DataSet and DataMember
is a set, then Timeline is bound to the DataTable with the respective
name in the DataSet.
-
DataDateField property - field name from the data source to bind to the Date property of the TimelineItem.
-
DataTitleField property - field name from the data source to bind to the Title property of the TimelineItem.
-
DataSubtitleField property - field name from the data source to bind to the Subtitle property of the TimelineItem.
-
DataDescriptionField property - field name from the data source to bind to the Description property of the TimelineItem.
-
DataImagesField property - field name from the data source to bind to the Images collection.
-
DataActionsField property - field name from the data source to bind to the Actions collection.
-
DataKeyNames property - lists the additional fields of the DataSource that will be mapped to each event item.
-
DataBind method - must be called after the aforementioned properties
are set when binding at runtime.