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

RadDatePicker: Disable / Hide Weekends

1 Answer 491 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Vinoth Kathappanraju
Top achievements
Rank 1
Vinoth Kathappanraju asked on 28 Aug 2016, 07:26 PM

Hi

I have a requirement to hide weekends to show up on the dropdown calendar control in RadDatePicker for WPF. I have gone through lots of google posts and telerik forum posts but couldn't find a way to do this. Is there a way to acheive this? If this is not possible, is there a easier way to disable selecting the weekends? The BlackoutDates collection won't work for me as i will need to insert all weekend dates from 1970 in to it and it is not a workable solution for us.

Thanks

Vinoth

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 29 Aug 2016, 08:47 AM
Hello Vinoth,

In the current implementation of RadDatePicker it is not possible to hide the weekends from the Calendar part of the control.

However, in order to achieve the desired behavior and prevent weekends from selection without using BlackoutDates you could use the DayButtonStyleSelector. Inside the selector you could check the day of the week of the date and disable that date from selection if it is a weekend day. Some more detailed information about the DayButtonStyleSelector you could find on the following link from our documentation:
http://docs.telerik.com/devtools/wpf/controls/radcalendar/styles-and-templates/daybuttonstyleselector

Attached you could find a sample project that demonstrates how to use DayButtonStyleSelector with RadDatePicker - please, check it.

We hope this will help you.

Regards,
Nasko
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
DatePicker
Asked by
Vinoth Kathappanraju
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or