Events in Blazor Timeline
27 Aug 20263 minutes to read
This section describes the Blazor Timeline events, which are triggered when specific actions are performed. The following events are available in the Blazor Timeline component.
Created
The Blazor Timeline component triggers the Created event when its rendering is complete.
@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 Blazor 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" }
};
}