Thursday, March 22, 2012

setting the monthin a calendar control

I am trying to programatically set the selected date on a calendar. The date comes from a database and the right date is selected but the month showing is Nov 03. You have to go to the correct month to see the selected day.

Calendar1.SelectedDates.Add(New DateTime(2003, 2, 2))
or
Calendar1.SelectedDate="02/02/2003"

either works but instead of feb. showing I see nov. am I missing something.You need to set the visible date property.
Calendar1.VisibleDate = New Date(2003, 2, 2)
Thank you that is what I needed.

0 comments:

Post a Comment