Calendar not changing months with selected date

4 posts, 1 answers
  1. goodbar
    goodbar avatar
    6 posts
    Member since:
    Oct 2013

    Posted 27 Oct 2013 Link to this post

    I have my RadCalendar for windows phone bound to a SelectedDate in my viewmodel and it updates back and forth just fine when the date changed is within the currently selected month, but if SelectedDate changes to a date in a month not already displayed on the calendar, the calendar does not change to that new month.  Is this a defect, or am I doing something wrong?



    Here is my xaml:




    <
    telerikInput:RadCalendar AppointmentSource="{Binding}" SelectedValue="{Binding SelectedDate, Mode=TwoWay}"

    MonthInfoDisplayMode="Small" WeekNumbersVisibility="Visible" DayNamesVisibility="Visible"/>

  2. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 30 Oct 2013 Link to this post

    Hello Joe,

    Thank you for contacting us.

    RadCalendar has a SelectedValue property which determines the date that is visualized as selected. However, this date is not necessarily part of the month that is currently visible. For example, if you tap on 31st of October, it will get selected. Then you can move to the next month, but this will not change the selection, unless you tap on another date. In order to programatically (or through data binding) change the month that is visible, you can use the DisplayDate property. When you change its value, the month that is currently visible will be changed accordingly. 

    I hope this information helps. Let me know if you need further assistance.
     
    Regards,
    Todor
    Telerik
    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. goodbar
    goodbar avatar
    6 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2013 Link to this post

    Thank you, this worked; although, an error is generated if you are bound to a date with the default datetime of 1/1/0001, so in the viewmodel I handle this on my get and if the date.year == 1, then I return DateTime.Today otherwise, I return the actual selected datetime.
  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 31 Oct 2013 Link to this post

    Hi Joe,

    I managed to reproduce the exception. It occurs when you get to the first month of the first year.
    This happens because as you can see when the first date of a month is not on Monday, the calendar displays dates from the previous month.Since the 1st of January in year 1 is not on Monday, this results in an attempt to display dates that are not supported in .NET. We will try to fix this for some of our further releases, but for now your solution seems to be the best workaround.

    I have updated your telerik points for reporting this issue.
     
    Regards,
    Todor
    Telerik
    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
DevCraft banner