New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Binding to a Shared DataSource

The Telerik UI Timeline for ASP.NET MVC widget could be bound to a shared data source. Whenever a change external to the Timeline is present, the widget's data source and UI will be automatically updated.

For a runnable example, refer to the demo on binding to a shared data source.

The following example demonstrates how to bind two Telerik UI for ASP.NET MVC widgets to the same data source. Changes done from one of the widgets is automatically reflected in the data source and UI of the other widget.

    @(Html.Kendo().DataSource<Kendo.Mvc.Examples.Models.TimelineEventModel>()
        .Name("sharedDataSource")
        .Custom(dataSource => dataSource
        .Transport(tr=>tr.Read(read => read.Action("GetEvents", "TimelineEvents")))
        )
    )

    @(Html.Kendo().Timeline<Kendo.Mvc.Examples.Models.TimelineEventModel>()
        .Name("Timeline")
        .DataDateField("EventDate")
        .DataDescriptionField("Description")
        .DataSubtitleField("Subtitle")
        .DataTitleField("Title")
        .DataImagesField("Images")
        .DataActionsField("Actions")
        .Orientation(TimelineOrientation.Vertical)
        .AlternatingMode()
        .CollapsibleEvents()
        .DataSource("sharedDataSource")
    )

    @(Html.Kendo().DropDownList()
        .Name("titles")
        .DataTextField("Title")
        .DataValueField("Title")
        .DataSource("sharedDataSource")
        .OptionLabel("Select an item...")
        .Value("Barcelona & Tenerife")
    )

See Also

In this article