Update binding i RadCalendar control

4 posts, 0 answers
  1. Mikael
    Mikael avatar
    7 posts
    Member since:
    Jul 2012

    Posted 09 Jan 2013 Link to this post


    I have an RadCalendar Control which I initially only loads with the current month. When the user swipes to another month, I make a call, and update the control.

    However, the new month does not get populated, unless I click on a date, or go back to the previus month, and then back again.
    Here is the code I use:

    calendar.AppointmentSource = App.ViewModel.CalendarViewModel;

    calendar.UpdateLayout();


    If this is a bug, are there any known workarounds?
    Regards
    Mikael
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 14 Jan 2013 Link to this post

    Hi Mickael,

    Thank you for writing.

    We are not aware of a similar issue. You can have a look at our Examples solution and/or the design template for the calendar, which you can find in the New Telerik Item wizard. In the example/template we demonstrate how to use the appointments in the calendar itself and also how to visualize them with RadDataBoundListBox. I hope this will help you adjust your setting and successfully populate the data. If this doesn't help you, I encourage you to open a new support ticket in order to attach a solution which can helps better identify the issue that you experience and find the cause for it.

    Regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Mikael
    Mikael avatar
    7 posts
    Member since:
    Jul 2012

    Posted 12 Feb 2013 Link to this post

    Sorry for the late reply, but I have a bit more information. It appears to be related to my custom DataTemplateSelector. The selector works fine, but it doesn't get triggered when the datacontext and/or AppointmentSource is updated.

    Is there a manual way to trigger this to happend?
  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 15 Feb 2013 Link to this post

    Hello Mikael,

    The template selector gets triggered when the DisplayDate or the SelectedValue get changed. However, if you change the SelectedValue the template will be evaluate only for the old and the new value of this property. If you need to reload the whole month, you can change the DisplayValue with something similar to this:
    calendar.DisplayDate = calendar.DisplayDate.AddMonths(1);
    calendar.DisplayDate = calendar.DisplayDate.AddMonths(-1);

    I hope this information helps.

    Kind regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top