New to Telerik UI for ASP.NET CoreStart a free 30-day trial

ASP.NET Core Timeline Overview

The Telerik UI Timeline TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Timeline widget.

The Timeline widget displays a collection of events and their data in a chronological succession for each year.

You can scroll through the events and collapse/expand them. The events order can be vertical or horizontal, and you can customize their templates, as well as respond to events and use API control the widget behavior. You can also control the format of the rendered date for the event. If you provide a list of actions, they will be rendered as links after the description and images.

UI for ASP.NET Core Timeline Overview

Initializing the Timeline

The following example demonstrates how to define the Timeline. Note the tabs for the controller and model code that show how to feed data to the widget.

Razor
    @(Html.Kendo().Timeline<MyApp.Models.TimelineEventModel>()
               .Name("Timeline")
               .DataDateField("EventDate")
               .DataDescriptionField("Description")
               .DataSubTitleField("Subtitle")
               .DataTitleField("Title")
               .DataImagesField("Images")
               .DataActionsField("Actions")
               .Orientation("vertical") // defines the layout of the widget
               .AlternatingMode() // renders the events on both sides of the axis in vertical mode
               .CollapsibleEvents() // starts all events collapsed in vertical mode
               .DataSource(dt => dt.Read("GetTimelineData", "Timeline"))
    )

Functionality and Features

Referencing Existing Instances

To access an existing Timeline instance, use the .data() jQuery method, executed by the jQuery object of the originating element. Once you have the reference, you can use the Timeline client-side API.

Razor
    @(Html.Kendo().Timeline<MyApp.Models.TimelineEventModel>()
        .Name("Timeline")
        .DataDateField("EventDate")
        .DataDescriptionField("Description")
        .DataSubTitleField("Subtitle")
        .DataTitleField("Title")
        .DataImagesField("Images")
        .DataActionsField("Actions")
        .Orientation("horizontal")
        .DataSource(dt => dt.Read("GetTimelineData", "Timeline")) // see the first example in this article for a sample data source
    )

    <button onclick="buttonClick();">Go to next event</button>

    <script>
        function buttonClick() {
            var timeline = $("#Timeline").data("kendoTimeline");
            timeline.next();
        }
    </script>

Next Steps

See Also