New to Telerik UI for Blazor? Download free 30-day trial

Decade Cell Template

The Decade Cell Template controls what the calendar will render in the <td> element for each year in the Decade view that lists the years.

The template receives the DateTime corresponding to its cell.

Mark some years on the calendar decade view

calendar decade cell template

@* This example adds an icon for certain years *@

<TelerikCalendar Date="@startDate" @bind-View="@theView">
    <DecadeCellTemplate>
        @if (yearsWithEvents.Contains(context.Year))
        {
            <TelerikIcon Icon="warning"></TelerikIcon>
        }
        @context.Year
    </DecadeCellTemplate>
</TelerikCalendar>

@code{
    DateTime startDate { get; set; } = new DateTime(2021, 4, 1);

    CalendarView theView { get; set; } = CalendarView.Decade;
    List<int> yearsWithEvents { get; set; } = new List<int>() { 2020, 2021 };
}

See Also

In this article
Not finding the help you need? Improve this article