Customise Title of Calendar

4 posts, 1 answers
  1. Akin
    Akin avatar
    6 posts
    Member since:
    Sep 2018

    Posted 04 Oct 2018 Link to this post

    I'd like to add some buttons to the style/template of the title in the calendar something like what is shown below, is this possible?
  2. Didi
    Admin
    Didi avatar
    382 posts

    Posted 05 Oct 2018 Link to this post

    Hi Akin,

    Thank you for the provided image.

    RadCalendar does not provide a template for the Title, however, you could achieve the required look by positioning a button above the control. I have created a sample example to show how you could implement it, please download the attached project and give it a try.

    Let me know if I can help with anything else regarding this.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Akin
    Akin avatar
    6 posts
    Member since:
    Sep 2018

    Posted 08 Oct 2018 in reply to Didi Link to this post

    Hi Didi,

    Thanks for the guidance, I did go a different route however. Which I'll post below in case someone else comes across this.

    I ended up creating a custom renderer for the RadCalendar that implements only the following for now.

    protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
            {
                base.OnElementChanged(e);
     
                if (Control != null)
                {
                    Control.ShowTitle = false;
                }
            }

     

    and in my XAML, I do the following 

    <views:CustomCalendarView Grid.Row="1"
        DisplayDate="{Binding CurrentDate, Mode=OneWayToSource}"/>

     

    I have a question on this approach too, is OnElementChanged the correct method to be overriding? I couldnt find an OnLoad or OnInitialise method?

     

  4. Answer
    Didi
    Admin
    Didi avatar
    382 posts

    Posted 09 Oct 2018 Link to this post

    Hi Akin,

    Thank you for the provided code.

    OnElementChanged is the correct method for overriding. As you are creating a custom renderer you need to create a custom class and override the OnElementChanged method. You can take a look in our documentation how the custom renderer for RadCalendar control should be implemented for Android, iOS and UWP

    Let me know if you have any other questions.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top