By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,564 Members | 810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,564 IT Pros & Developers. It's quick & easy.

setting calendar.selectedDate using code?

P: n/a
Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just fine
Thanks for any clue.
Regards
Victor
Nov 28 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Set the SelectedDate and the VisibleDate properties in code.
That works for me.
Victor Reboucas wrote:
Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just fine
Thanks for any clue.
Regards
Victor
Nov 28 '06 #2

P: n/a
Hi Gozirra,

That's what I'm doing... setting the selectedDate and visibleDate in code,
and the "visual demonstration" of the calendar control do not get updated...
regards,
Victor

"Gozirra" <rm********@hotmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Set the SelectedDate and the VisibleDate properties in code.
That works for me.
Victor Reboucas wrote:
>Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set
it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just
fine
Thanks for any clue.
Regards
Victor

Nov 29 '06 #3

P: n/a
I found that...

You just need to set the selectedDate property to "Today" instead of "Now"
(I don't know why)

there's a thread here...
http://discuss.joelonsoftware.com/de...et.12.412786.7

regards,
Victor
"Gozirra" <rm********@hotmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Set the SelectedDate and the VisibleDate properties in code.
That works for me.
Victor Reboucas wrote:
>Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set
it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just
fine
Thanks for any clue.
Regards
Victor

Nov 29 '06 #4

P: n/a
Have you checked if your selected day style is visible?

On Tue, 28 Nov 2006 18:41:19 -0300, "Victor Reboucas"
<vc***@hotmail.comwrote:
>Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just fine
Thanks for any clue.
Regards
Victor
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 29 '06 #5

P: n/a
Well, well, the answer is: you cannot set the selectedDate property to any
date/datetime variable that holds hour, minute or seconds different than 0.

If you set it like: cld.selectedDate = new DateTime(2006,12,29,0,0,0) - It
works just fine...

but if you set it like: cld.selectedDate = new DateTime(2006,12,29,0,0,1) -
The calendar control holds the correct dateTime valeu but do not mark the
day as selected visually.

PS: this was not the behavior in asp.net 1.0 / 1.1, where both approaches
work fine.
regards,
Victor

"Gozirra" <rm********@hotmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Set the SelectedDate and the VisibleDate properties in code.
That works for me.
Victor Reboucas wrote:
>Hi, I'm sure I'm missing something here, but....

I have a asp.net 2.0 web form and a calendar control.

If I set the selectedDate clicking the control, no problem, but, if I set
it
using code I cannot get the visual demonstration of the selectedDate...

I mean, if I check the selectedDate using code I can get it, but it's not
shown visually.
PS: it's not about the VisibleDate property, this property works just
fine
Thanks for any clue.
Regards
Victor

Nov 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.