Welcome Guest Search | Active Topics | Sign In | Register

Highlight multiple days on Calendar Control Options
Jim Nelson
Posted: Monday, May 9, 2011 11:00:24 AM
Rank: Member
Groups: Member

Joined: 9/1/2010
Posts: 28
I am using the calendar control and all is working fine so far.

But, I need to be able to "highlight" multiple days in a month to indicate there are schedule items on those days. I tried using

Calendar1.SelectedDates.Add(DateTime.Now.AddDays(5));
Calendar1.SelectedDates.Add(DateTime.Now.AddDays(6));
Calendar1.SelectedDates.Add(DateTime.Now.AddDays(7));
Calendar1.SelectedDates.Add(DateTime.Now.AddDays(8));

but the days in the calendar to not have a box or are highlighting on those days.

Not sure what I am doing wrong. I also could not find the SelectedDateStyle property thinking that was why it was not showing.

Thanks for your help.

<eo:Calendar ID="Calendar1" runat="server" ControlSkinID="Outlook2003" DisabledDates=""
SelectedDates="2011/05/18" AutoPostbackOnSelect="true" TitleVisible="true" MonthSelectorVisible="true"
WeekSelectorVisible="true" OnSelectionChanged="Calendar1_SelectionChanged">
</eo:Calendar>
eo_support
Posted: Monday, May 9, 2011 11:28:32 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your code is correct. We verified the same code and it works fine here.

Thanks
Jim Nelson
Posted: Monday, May 9, 2011 12:14:54 PM
Rank: Member
Groups: Member

Joined: 9/1/2010
Posts: 28
Had a small error. I see it working now.
Have another question regarding SelectedDates.
When I actually click on day it clears all the other SelectedDates.

Is there a way to have the SelectedDates cleared only if I clear them or do I need to "re-select" them each time the user selects one of the days.

thx
eo_support
Posted: Monday, May 9, 2011 12:42:07 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This is no way to prevent SelectedDates to be cleared when user selects a single date. If you wish a date to appear differently regardless user action, you can use custom rendering by handling DayRender event. That would not have anything to do with SelectedDate/SelectedDates or any of the style property. Instead you will be generating the output for each day cell and you can render any HTML/style you like there.

Thanks


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.