DayTemplateSelector Calendar Not working

5 posts, 0 answers
  1. Anup
    Anup avatar
    13 posts
    Member since:
    Aug 2011

    Posted 10 May 2013 Link to this post

    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.
  2. Anup
    Anup avatar
    13 posts
    Member since:
    Aug 2011

    Posted 10 May 2013 Link to this post

    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
  3. DevCraft banner
  4. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 14 May 2013 Link to this post

    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.

  5. Anup
    Anup avatar
    13 posts
    Member since:
    Aug 2011

    Posted 14 May 2013 Link to this post

    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...
  6. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 17 May 2013 Link to this post

    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.

Back to Top
DevCraft banner