Calendar control to only display a set of selectable dates

Jun 29, 2009 at 3:44 PM

Hi Y'All ;-)

Currently, the Calendar control allows you to mark blockout dates, which are not allowed for selection. I need just the opposite effect in that I would like to mark a set of dates that are the only ones that are selectable. Is there a way to do this?


Jul 7, 2009 at 8:11 AM
Edited Jul 7, 2009 at 8:13 AM

If you look at the source (Calendar.cs), you'll see that the code is only checking the BlackedoutDates collection. There is no inverted CalendarBlackoutDatesCollection collection and there seems to be no mechanism where you can create your own BlackoutDates collection to be used in its stead. (unless you modify the original source)

BTW: Have you seen BlackoutDates.AddDatesInPast()? It is easy to add a range that covers the entire timespan that DateTime covers.

Aug 20, 2009 at 10:48 AM

Hi Hanoverian,


Did you ever get around this requirement ?

I have an almost similar situation where I need to enable ony specific dates (for e.g. the second day from todya, the 7th day and the 9th day). All other dates should be blackout dates.