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

Styling today's date

2 Answers 100 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
ProXy
Top achievements
Rank 1
ProXy asked on 11 Sep 2015, 05:59 AM

Hello,

 I would like to extend the Calendar control to add the SpecialDays-Feature. I was able to override the SelectTemplate function and return two different DataTemplates. I also added a list of dates to the control, all those days are shown bold red in the calendar. This works fine if IsTodayHighlighted is set to false - whenever I enable this feature, the style of my SpecialDay-Feature is overwritten. How can I modifiy the style of the today field, based on the list that is bound to the control?

 

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 15 Sep 2015, 02:27 PM
Hello Stefan,

The observed by you behavior is probably caused by the implemented logic inside your SelectTemplate method. When the IsTodayHighlighted property is set to True the ButtonType of the button is set to CalendarButtonType.TodayDate and if inside the SelectTemplate you do not have any implemented logic for that type of buttons no template will be applied.

Please, check the attached sample project that demonstrates how a template gets applied when IsTodayHighlighted is to True implementing some logic for handling CalendarButtonType.TodayDate ButtonTypes.

We hope this will help you.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
ProXy
Top achievements
Rank 1
answered on 16 Sep 2015, 09:44 AM

Hello Nasko,

 

thank you for the answer. You were completely right, I missed the ButtonType TodayDate.

 

Thanks,

Stefan

Tags
Calendar
Asked by
ProXy
Top achievements
Rank 1
Answers by
Nasko
Telerik team
ProXy
Top achievements
Rank 1
Share this question
or