Calander with Special Days displays incorrect days

5 posts, 0 answers
  1. Shawn
    Shawn avatar
    22 posts
    Member since:
    Jul 2011

    Posted 30 Apr 2014 Link to this post

    I have a project that uses the SpecialDays Property on the RadCalendar. The calendar will consistently display incorrectly when the user changes months. I have created a test project to replicate the issue. 

    SpecialDays.png displays the month of April with six special days. When the user changes to March and then back to April we end up with a screen like SpecialDaysAfter.png. In this state the calendar is incorrectly displaying the previous months dates and just replacing the special days. From this point on, all other months display incorrectly as well.

    You can download my test project here.

    Is there a way to fix this behavior? Am I incorrectly using the special days?

    Regards,
    Shawn
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 01 May 2014 Link to this post

    Hi Shawn,

    Thank you for providing the project. Indeed, the templates are not updated properly. However, we will need some additional time to further research the case. I will write again as soon as we have a result.

    Regards,
    Yana
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
  4. Shawn
    Shawn avatar
    22 posts
    Member since:
    Jul 2011

    Posted 01 May 2014 in reply to Yana Link to this post

    Hello Yana,

    I have discovered a work around for the issue:

    Subscribe to the DisplayDateChanged event on the calendar. In the event set the SpecialDays to an empty List of DateTimes. And then set it back to the actual list of special days. This seems to reset the calendar and it properly displays the special days.

    private void uxCalendar_DisplayDateChanged(object sender, Telerik.Windows.Controls.Calendar.CalendarDateChangedEventArgs e)
            {
               // whenever we change a month we need to clear the special days list
               // and then we need to set it back to what it's supposed to be
               uxCalendar.SetValue(RadCalendarBehavior.SpecialDaysProperty, new List<DateTime>());
               uxCalendar.SetValue(RadCalendarBehavior.SpecialDaysProperty, SpecialDays);
            }

    Regards,
    Shawn
  5. Kirk
    Kirk avatar
    28 posts
    Member since:
    Jun 2012

    Posted 13 Aug 2014 Link to this post

    Are there any updates on this issue? The work around seems to have stopped working as well. I haven't spent any time to try to figure out why yet, I wanted to check on the status first.
  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 18 Aug 2014 Link to this post

    Hello Kirk,

    When using a custom DayTemplateSelector you should define and return a default template instead of the returning base.SelectTemplate as it is always returns null. That was the issue with the provided project - I have modified it in order to include a default template and return it instead of the base. Please try the same approach and let me know if it helps.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
DevCraft banner