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

Dynamic re-styling of drop-down date picker

1 Answer 81 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 04 May 2011, 10:59 AM
Hello,

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. 

Behavior:
  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?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 11 May 2011, 01:39 PM
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,
Dani
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
Tags
DateTimePicker
Asked by
Igor
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or