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

DayTemplateSelector not refreshed on binding change

1 Answer 395 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 10 Jul 2014, 03:52 PM
Hey,

I am using a DayTemplateSelector to on my RadCalendar to show a different style for days that have appointments. With my test setup this works fine, but when I'm contacting a service to retrieve appointment, the collection is empty at the moment the month is switched and the appointments are added on arriving back from the service (one by one).

The problem now is that the selector is not triggered when the binded property is changing. Is there a way to force a update on the selector?

I found a post with the next solution:
calendar.DisplayDate = calendar.DisplayDate.AddMonths(1);
calendar.DisplayDate = calendar.DisplayDate.AddMonths(-1);

BUT this will not work for me, when you change the mont the current date will be changed and I will retrieve a new list and the binded list is empty again. Why is the selector not listing to the changes of the property in the datacontext?

1 Answer, 1 is accepted

Sort by
1
Konstantina
Telerik team
answered on 11 Jul 2014, 02:53 PM

Hi Rob,

The DataTemplateSelector doesn't get re-evaluated when a PropertyChanged notification is fired.
This is a common issue, so I would suggest you go through these forum discussion, where several solutions are proposed:

- http://social.msdn.microsoft.com/Forums/en-US/81e14539-c928-4879-bbb0-a1d3ef674130/wpf-reapply-datatemplateselector-when-a-certain-value-changes?forum=wpf

- http://stackoverflow.com/questions/3543515/wpf-reapply-datatemplateselector-when-a-certain-value-changes

Hope this helps.

Regards,

Konstantina
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
Rob
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or