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

[Solved] DayTemplateSelector Calendar Not working

4 Answers 104 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anup
Top achievements
Rank 2
Anup asked on 10 May 2013, 08:50 AM
Hello,

Will you please help on this...

I am using Version 2013.1.403.1050 where the Event DisplayDateChanged  is not calling on changing or selecting date on the control...so The Override Method...public override DataTemplate SelectTemplate(object item, DependencyObject container)  is not called...and my template remain as it is...

where as Version 2012.1.326.1050  working perfect.. on changing dates..the templates changes...

Is this version issue exactly or its my fault.... please have your kind attention on this...soon

will you please help me as soon as possible as it is critical issue for me...

also mention when public override DataTemplate SelectTemplate(object item, DependencyObject container) this event got call???

Thank you,
Regards,
Anup Shah.

4 Answers, 1 is accepted

Sort by
0
Anup
Top achievements
Rank 2
answered on 10 May 2013, 09:15 AM
Hello,

As Version Query arise...i just my all the DLL to the 2012 Version DLL  and just it working as before perfectly....

Will You please.... help me on this... what to do for this kind of scenario in Version 2013.

Regards,
Anup
0
Vladi
Telerik team
answered on 14 May 2013, 06:18 AM
Hi,

Thank you for contacting us.

In the 2012.1.326.1050 version of RadCalendar the described behavior was a bug that was introduced and fixed which caused the DisplayDateChanged event to be triggered when a selection was made. By design this event should be fired when the DisplayDate property of the control is changed not when the SelectedDate is changed.

There are two possible solution for this to work in your scenario:
  1. It is recommended to use the SelectionChanged that is triggered when an date is selected and add your logic in that event.
  2. Or again use the SelectionChanged event but in it set the DisplayDate of the control to the SelectedDate property. This would cause the DisplayDateChanged to be triggered when a selection is made.

Hope this is helpful


Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anup
Top achievements
Rank 2
answered on 14 May 2013, 11:35 AM
Hello Vladi,

Thank you very much for the reply...

I have done all along a bad logic with this Bug ahead...

but now... for the bug i have tried the code below 

var oldTemplate = calendar.Template;
calendar.Template = null;
calendar.Template = oldTemplate;


which refreshes the calendar is this the way i used???

Please have your kind attention here...
0
Vladi
Telerik team
answered on 17 May 2013, 08:13 AM
Hi,

In the RadCalendar control when you just set its Template property the control will refresh its template. You should know that refreshing the template on every selection (in the SelectionChanged event) of the calendar could cause some issues because the hole control is reloaded. Could you describe to us in more details the scenario that causes you to refresh the hole template of the control on each selection as there may be a better approach in achieving the desired behavior?

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Calendar
Asked by
Anup
Top achievements
Rank 2
Answers by
Anup
Top achievements
Rank 2
Vladi
Telerik team
Share this question
or