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

Changing Dates programmatically and ensuring the selected date is in view on calendar

1 Answer 199 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Akin
Top achievements
Rank 1
Akin asked on 09 Oct 2018, 05:30 AM

Hi all,

I'm running into a problem with changing the selected date of the calendar using binding (MVVM), I can successfully use the built in Xamarin.Forms DatePicker to change the selected date of the calendar, however when I do change it to say 3 years from today, the RadCalendar does not change to ensure the selected date is in view.

I haven't found an override or anything in a custom renderer to get this behaviour to go, is this possible to implement?

Cheers,

Akin

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 09 Oct 2018, 02:40 PM
Hi Akin,

You would need also to update the DisplayDate property of the Calendar when the SelectedDate is in different Month/Year in order to ensure the SelectedDate is in the current view. 
You could bind DisplayDate to a property in the ViewModel and switch it according to the value of the DatePicker.  I have attached a sample app to demonstrate the exact implementation. Please download it and give it a try.

Let me know if you have any additional questions.

Regards,
Yana
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
Yana
Telerik team
Share this question
or