DotNet2.0 Calendar SelectedDate

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
 
M

Mark Rae

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...?
 
N

Nathan Sokalski

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.
 
S

Steven Nagy

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top