Rank: Newbie Groups: Member
Joined: 12/29/2010 Posts: 7
|
The task is to set a few dates enabled in Calendar, while the rest remains disabled. E.g only 6 days in year 2011 are enabled: 01/15/2011, 01/20/2011, 02/16/2011-02/19/2011. I need to have a way to disable everything and then make some days enabled. I have tried Day_Render, but e.Day.IsDisabled is readonly property there. I also don't want to use MonthChange / Scroll postbacks, all enabled dates for whole year should be set at once.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can add all the dates you want to disable into DisabledDates. But that would be quite inefficient. If the performance is acceptable to you, then that is the easiest solution.
Alternatively, you can still enable all dates but render them as if they are disabled (for example, give them a gray color), then handle the Calendar's SelectionChanged event (if you do handle it on the server side) but perform additional logic in your handler to check whether the selected date is disabled, This will be more code but more efficient.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 12/29/2010 Posts: 7
|
Thanks. Hadling on server is not acceptable. So I will use DisabledDates and test how many dates I can disable without much performance loss.
|