473,382 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

setting calendar.selectedDate using code?

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
5 7150
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: js | last post by:
Any way to modify an <asp:Calendar> tag with parameters on the fly? Seems I'm not allowed to use the <% =xxx %> substitution for parameters to the <asp:Calendar> tag. Do I have to do code...
2
by: D. Shane Fowlkes | last post by:
http://www.drumpub.com/caltest.aspx Check the test page at the above link. Could someone please tell me why I'm capturing the calendar's SelectedDate "one post behind"? The source code is on...
2
by: Mariano Padilla | last post by:
The calendar control only has the event of SelectionChanged to detect if the user clicks on the calendar. I have 2 calendars on a form, one for arrival date one for departure date. Every time a...
1
by: R.A.M. | last post by:
Hi, I need to set BirtDate TextBox with a date taken from another browser window with Calendar control. I tried this way: On first page I have: Birth date: <asp:TextBox ID="BirthDate"...
0
by: targus | last post by:
Please help, I need a solution to this problem. What I want to do: I have a history grid that gets filled with 2 weeks data prior to a specified date. The user picks the specified date from the...
4
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
0
by: Mark Sandfox | last post by:
I created a simple calendar test app (webform1.aspx) using Visual Studios, which works perfectly in local debug mode, but has no functionality when posted to the website. I.e. the label fills with...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
1
by: Leon_Amirreza | last post by:
When I Set the Calendar.SelectedDate Property programatically that Day's style doesnt change according to the styles set in Calendar property so the user wont see the change in SelectedDate BUT...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.