Author: kcis8rm | Posted on: 8/5/2008 1:49:38 AM | Views : 314

Hi

I need to create a calendar control programatically using c#. So far I've managed to create the control and set its selected date using the code below:
Calendar c = new Calendar();
c.SelectedDate = DateTime.Now.AddDays(7);
c.SelectedDayStyle.BackColor = System.Drawing.Color.DarkBlue;
c.SelectedDayStyle.BorderColor = System.Drawing.Color.Blue;
c.SelectedDayStyle.BorderStyle=BorderStyle.Solid;
c.SelectedDayStyle.BorderWidth = 1;
c.VisibleDate = c.SelectedDate;
Then I added it to my page. The problem is that although the calendar control is rendered to the page as expected the selected date is not shown. I would have thought the day 7 days from todays date would be highlighted blue with a dark blue border, but this does not seem to happen!

Can someone tell me where I've gone wrong please?

Many thanks

Ross 
...

Go to the complete details ...