By default, the timeline is vertical, with events arranged on one side of the axis.
You can have the events render alternatingly on both sides of the axis by adding its .AlternatingMode() option.
If you add the .CollapsibleEvents() option, all events will start out collapsed (by default, all events are expanded). The user can then expand a particular event to see more than its title and subtitle.
Razor
@(Html.Kendo().Timeline<MyApp.Models.TimelineEventModel>().Name("Timeline").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.DataDateField("EventDate").DataDescriptionField("Description").DataSubTitleField("Subtitle").DataTitleField("Title").DataImagesField("Images").DataActionsField("Actions").DataSource(dt => dt.Read("GetTimelineData","Timeline")))
publicpartialclassTimeline:BaseController{publicJsonResultGetTimelineData(){List<TimelineEventModel> events =newList<TimelineEventModel>();
events.Add(newTimelineEventModel(){
Title ="Barcelona \u0026 Tenerife",
Subtitle ="May 15, 2015",
Description ="First event description.",
EventDate =newSystem.DateTime(2015,4,15),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/Barcelona-and-Tenerife/Arc-de-Triomf,-Barcelona,-Spain_Liliya-Karakoleva.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about Barcelona", url="https://en.wikipedia.org/wiki/Barcelona"}}});
events.Add(newTimelineEventModel(){
Title ="United States East Coast Tour",
Subtitle ="Feb 27, 2018",
Description ="The second event description.",
EventDate =newSystem.DateTime(2018,1,27),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/United-States/Boston-Old-South-Church_Ivo-Igov.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about New York City", url="https://en.wikipedia.org/wiki/New_York_City"}}});
events.Add(newTimelineEventModel(){
Title ="Malta, a Country of Knights",
Subtitle ="My second trip this year",
Description ="Third event description.",
EventDate =newSystem.DateTime(2015,5,25),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/Malta/Bibliotheca-National-Library_Marie-Lan-Nguyen.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about Malta", url="https://en.wikipedia.org/wiki/Malta"}}});eturnJson(events);}}
C#
publicclassTimelineEventModel{publicstring Title {get;set;}publicstring Subtitle {get;set;}publicstring Description {get;set;}publicDateTime EventDate {get;set;}publicList<TimelineEventImageModel> Images {get;set;}publicList<TimelineEventActionModel> Actions {get;set;}}publicclassTimelineEventImageModel{publicstring src {get;set;}// this field name must be "src"}publicclassTimelineEventActionModel{publicstring text {get;set;}// this field name must be "text"publicstring url {get;set;}// this field name must be "url"}
To use the horizontal rendering, set the .Orientation("horizontal") option.
In the horizontal mode, the timeline renders buttons the user can click or tap to navigate between periods. There is always one rendered event below the time axis, and the user can select another to reveal its details.
The horizontal mode renders the event details on demand (only when they are selected), and is responsive (renders as many of the events as there is room on the axis for).
Alternating rendering and collapsing is not available for the events in this mode.
Razor
@(Html.Kendo().Timeline<MyApp.Models.TimelineEventModel>().Name("Timeline").Orientation("horizontal")// defines the layout of the widget.DataDateField("EventDate").DataDescriptionField("Description").DataSubTitleField("Subtitle").DataTitleField("Title").DataImagesField("Images").DataActionsField("Actions").DataSource(dt => dt.Read("GetTimelineData","Timeline")))
publicpartialclassTimeline:BaseController{publicJsonResultGetTimelineData(){List<TimelineEventModel> events =newList<TimelineEventModel>();
events.Add(newTimelineEventModel(){
Title ="Barcelona \u0026 Tenerife",
Subtitle ="May 15, 2015",
Description ="First event description.",
EventDate =newSystem.DateTime(2015,4,15),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/Barcelona-and-Tenerife/Arc-de-Triomf,-Barcelona,-Spain_Liliya-Karakoleva.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about Barcelona", url="https://en.wikipedia.org/wiki/Barcelona"}}});
events.Add(newTimelineEventModel(){
Title ="United States East Coast Tour",
Subtitle ="Feb 27, 2018",
Description ="The second event description.",
EventDate =newSystem.DateTime(2018,1,27),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/United-States/Boston-Old-South-Church_Ivo-Igov.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about New York City", url="https://en.wikipedia.org/wiki/New_York_City"}}});
events.Add(newTimelineEventModel(){
Title ="Malta, a Country of Knights",
Subtitle ="My second trip this year",
Description ="Third event description.",
EventDate =newSystem.DateTime(2015,5,25),
Images =newList<TimelineEventImageModel>(){newTimelineEventImageModel(){ src ="https://demos.telerik.com/aspnet-mvc/tripxpert/Images/Gallery/Malta/Bibliotheca-National-Library_Marie-Lan-Nguyen.JPG?width=500&height=500"}},
Actions =newList<TimelineEventActionModel>(){newTimelineEventActionModel(){ text ="More info about Malta", url="https://en.wikipedia.org/wiki/Malta"}}});returnJson(events);}}
C#
publicclassTimelineEventModel{publicstring Title {get;set;}publicstring Subtitle {get;set;}publicstring Description {get;set;}publicDateTime EventDate {get;set;}publicList<TimelineEventImageModel> Images {get;set;}publicList<TimelineEventActionModel> Actions {get;set;}}publicclassTimelineEventImageModel{publicstring src {get;set;}// this field name must be "src"}publicclassTimelineEventActionModel{publicstring text {get;set;}// this field name must be "text"publicstring url {get;set;}// this field name must be "url"}