Welcome Guest Search | Active Topics | Sign In | Register

Calendar: define enabled dates Options
Oleh
Posted: Wednesday, January 5, 2011 7:35:05 AM
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.
eo_support
Posted: Wednesday, January 5, 2011 7:42:49 AM
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!
Oleh
Posted: Wednesday, January 5, 2011 8:24:51 AM
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.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.