Reputation: 51
I need to be able to choose only certain days of the week from DateTimePicker. I would like to know if it's possible to force the user to choose any day from MON-FRI, and just disable the SAT & SUN. I can understand that I can create pre-selection events that would pop-up a message asking user to re-select their days. I wanted to see if there is way to automatically disable the SAT & SUN and just have the user only select any day from MON-FRI.
Upvotes: 4
Views: 2204
Reputation: 1194
There's no built-in functionality for the DateTimePicker to limit dates outside of being able to choose when the date picker starts and ends. (IE, you can't block out dates that fall "inside" that range.)
Instead, you'll either need to use an alternative (and some free-to-use ones do exist) or check the date on the Validate event and if it's invalid according to your date rules, reset the date and present an error.
Upvotes: 4