DotNet2.0 Calendar SelectedDate

  • Thread starter Thread starter Steven Nagy
  • Start date Start date
S

Steven Nagy

Hey all,

On page load I am setting the selected date to DateTime.Now but its not
appearing as selected when the page loads. I have set the selection
mode to CalendarSelectionMode.Day since the user should only be able to
select one date. I've also set VisibleDate to DateTime.Now

No love from my calendars though. On a post back it is detecting that
today is selected, but it just won't show that visually on form load.

Any ideas?

Thanks,
Steven
 
No love from my calendars though. On a post back it is detecting that
today is selected, but it just won't show that visually on form load.

Any ideas?

Well, what happens differently on post back...?
 
What happens if you set SelectedDate and VisibleDate in the Init event? The
Init event happens earlier than Load, and it is the event where setting
values that are not determined by postback values are usually set.
 
That solved it Nathan.
Although I thought the only stuff to go in Init would be pre-viewstate
stuff (like setting up datagrid columns, etc). I thought that anything
like this would actually go into PreRender but it wasn't working there
either.

Thanks team!
 
Back
Top