Events in Blazor Timeline component
10 Oct 20253 minutes to read
This section describes the Blazor Timeline events, which are triggered when appropriate actions are performed. The following events are available in the Timeline component.
Created
The Timeline component triggers the Created event when its rendering is completed.
@using Syncfusion.Blazor.Layouts
<div class="container" style="height: 350px">
<SfTimeline Created="TimelineCreated">
<TimelineItems>
@foreach (var item in timelineItems)
{
<TimelineItem>
<Content> @item.Content </Content>
</TimelineItem>
}
</TimelineItems>
</SfTimeline>
</div>
@code {
public void TimelineCreated()
{
// Here, you can customize your code.
}
public class TimelineItemModel
{
public string Content { get; set; }
}
private List<TimelineItemModel> timelineItems = new List<TimelineItemModel>()
{
new TimelineItemModel() { Content = "Planning" },
new TimelineItemModel() { Content = "Developing" },
new TimelineItemModel() { Content = "Testing" },
new TimelineItemModel() { Content = "Launch" }
};
}ItemRendered
The Timeline component triggers the ItemRendered event after each item is rendered.
@using Syncfusion.Blazor.Layouts
<div class="container" style="height: 350px">
<SfTimeline ItemRendered="TimelineItemRendered">
<TimelineItems>
@foreach (var item in timelineItems)
{
<TimelineItem>
<Content> @item.Content </Content>
</TimelineItem>
}
</TimelineItems>
</SfTimeline>
</div>
@code {
public void TimelineItemRendered(TimelineRenderedEventArgs args)
{
// Here, you can customize your code.
}
public class TimelineItemModel
{
public string Content { get; set; }
}
private List<TimelineItemModel> timelineItems = new List<TimelineItemModel>()
{
new TimelineItemModel() { Content = "Planning" },
new TimelineItemModel() { Content = "Developing" },
new TimelineItemModel() { Content = "Testing" },
new TimelineItemModel() { Content = "Launch" }
};
}