Issue with showing multiple dates in a webcalendar

3 replies. Last post: May 9, 2012 5:02 AM by Hans Kristian
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Sachin JainMember

Hi,

I am trying to show various random dates on the calendar ( For example 7/1/2008, 7/7/2008, 7/10/2008, 8/12/2008 etc) in a web calendar. When I set the SelectedDate property of the web calendar it only selects one date in the calendar. I have also tried using SelectedDates property to set multiple dates. But in this case only the first date is highlighted on the calendar. Is there a way by which I can show multiple dates highlighted in the calendar.

Here is how the code looks like:

<ISWebEssentials:WebCalendar ID="WebCalendar1" runat="server" Height="560px" Width="800px" CalendarItemHeight="178px" NumberOfCalendarDisplayed="12"
               ShowWeekNumbers="false" EnableMultipleSelection="true" EnableKeyboardSupport="true" WeekViewMode="WorkWeek"
               HighlightTodayDate="False" HighlightMode="Day" AllowDefaultStyleMerging="false">
</ISWebEssentials:WebCalendar>

 

C# backend code to show multiple dates on the Webcablenar

DateTime TestDate = new DateTime("2008-07-01")

WebCalendar1.InitialDisplayDate = TestDate;

//WebCalendar1.SelectedDate = TestDate;

WebCalendar1.SelectedDates.Clear();

for (DateTime MyDate = TestDate.AddDays(2); MyDate < this.AppDatabase.CurrentDateTime.AddDays(17); MyDate = MyDate.AddDays(1))

{

WebCalendarSelectedDates SelectedDate = new WebCalendarSelectedDates();

SelectedDate.Date = MyDate;

WebCalendar1.SelectedDates.Add(SelectedDate);

}

 

Thanks.

Sachin

All times are GMT -5. The time now is 3:11 AM.
Previous Next