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

Calander with Special Days displays incorrect days

4 Answers 111 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 30 Apr 2014, 02:39 PM
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

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 May 2014, 12:21 PM
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.
 
0
Shawn
Top achievements
Rank 1
answered on 01 May 2014, 01:45 PM
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
0
Kirk
Top achievements
Rank 1
answered on 13 Aug 2014, 05:42 PM
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.
0
Kalin
Telerik team
answered on 18 Aug 2014, 02:25 PM
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.
 
Tags
Calendar
Asked by
Shawn
Top achievements
Rank 1
Answers by
Yana
Telerik team
Shawn
Top achievements
Rank 1
Kirk
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or