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

How to access Calendar TodayCellStyle and SelectedCellStyle in iOS custom renderer


Product Version 2020.2.513.1
Product Calendar for Xamarin Cross-Platform


This help article will show you how to access calendar properties set in Xamarin.Forms inside the Custom Renderer


You will need to pass the Element from the Renderer to the Delegate:


Here is a sample Calendar definition in XAML with TodayCellStyle and SelectedCellStyle properties set:

        <telerikInput:CalendarCellStyle BorderColor="Transparent" BackgroundColor="Gray" TextColor="White"/>
        <telerikInput:CalendarCellStyle  BorderColor="Transparent" BackgroundColor="White" TextColor="Gray"/>

and the custom renderer implementation for iOS

public class CustomCalendarRenderer : CalendarRenderer
    protected override CalendarDelegate CreateCalendarDelegateOverride()
        return new CustomCalendarDelegate(this.Element);

public class CustomCalendarDelegate : CalendarDelegate
    private RadCalendar element;

    public CustomCalendarDelegate(RadCalendar element) : base()
        this.element = element;
    public override void UpdateVisualsForCell(TKCalendar calendar, TKCalendarCell cell)
        var dayCell = cell as TKCalendarDayCell;
        // here is how we can get the TodayCellStyle and SelectedCellStyle
        var cellColor = element.TodayCellStyle.BackgroundColor.ToUIColor();
        var cellSelectedColor = element.SelectedCellStyle.BackgroundColor.ToUIColor();
In this article