Dynamic re-styling of drop-down date picker

2 posts, 0 answers
  1. Igor
    Igor avatar
    1 posts
    Member since:
    Apr 2011

    Posted 04 May 2011 Link to this post


    I use Telerik RadControls for SL 2010 Q2
    I have a custom control that contains RadDatePicker in DateOnly format and check box.
    I need to change style of the specific date in dependence of checking state of the check box. Let's say, I need to paint the15th of current month in red and disable date selection if check box is checked and paint it in green and enable date selection if it is unchecked. 
    I use CalendarStyle and DayTemplateSelector. 

    1. Load page for the first time.
    2. Check my check box and open calendar after that, the date is pained in red, that's correct.
    3. Uncheck the check box and open calendar again,  the date is not re-painted as expected, methods of DayTemplateSelector hasn't being called.
    4. Change a month in the calendar and come back to the current one, the target date is re-painted in the correct color.

    Please, what should I do to make the date to be re-painted correctly?

  2. Dani
    Dani avatar
    848 posts

    Posted 11 May 2011 Link to this post

    Hi Igor,

    We apologize for the delayed answer. It seems that what you need to do in addition is to refresh the selector intentionally when the checkbox is checked. You can  set it to null and then insert the rest of the code you wish to be executed.

    If this does not help, please send us a working sample that reproduces this behavior, so that we can check what has gone wrong.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top