This is a migrated thread and some comments may be shown as answers.

Customise Title of Calendar

3 Answers 90 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Akin
Top achievements
Rank 1
Akin asked on 05 Oct 2018, 01:42 AM
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?

3 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 05 Oct 2018, 02:46 PM
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
0
Akin
Top achievements
Rank 1
answered on 08 Oct 2018, 11:27 PM

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?

 

0
Accepted
Didi
Telerik team
answered on 09 Oct 2018, 12:25 PM
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
Tags
Calendar & Scheduling
Asked by
Akin
Top achievements
Rank 1
Answers by
Didi
Telerik team
Akin
Top achievements
Rank 1
Share this question
or