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

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

    Posted 09 Oct 2018 Link to this post

    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

  2. Answer
    Yana
    Admin
    Yana avatar
    5044 posts

    Posted 09 Oct 2018 Link to this post

    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
Back to Top