DateTimePicker, Set background custom color for some dates

1 Answer 66 Views
DateTimePicker
Aymen
Top achievements
Rank 1
Aymen asked on 12 Sep 2024, 08:45 AM

I am using DateTimePicker on WPF and I would like to know if there is a way to modify the bacjgroud color of the DateTimePicker for a couple of dates.

 

Thank you in advance.

1 Answer, 1 is accepted

Sort by
-1
Stenly
Telerik team
answered on 16 Sep 2024, 11:55 AM

Hello Aymen,

The RadDateTimePicker control internally uses a RadCalendar, which provides functionality for customizing the CalendarButton elements (this element represents each date in the calendar part) that will allow you to achieve the desired behavior:

WPF Calendar - How to Customize the Calendar Buttons - Telerik UI for WPF

Generally, you can follow the approach from the above article and combine it with the API that the RadDateTimePicker control exposes for customizing the RadCalendar element:

WPF DateTimePicker - Styling the Calendar - Telerik UI for WPF

With this being said, I have attached a sample project for you to test, which produces the following result when using the above two articles:

I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DateTimePicker
Asked by
Aymen
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or