473,396 Members | 1,917 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,396 software developers and data experts.

Changing the selecteddate of a calendar control in code

Hi all,

I use a calendar control in an ASP.NET form that is used to capture the
date of a specific task. I want to be able to show this date at some
future point in time by setting the SelectedDate of the calendar
control to the value returned from a database. This all works fine and
the selected date is indeed highlighted. However, if the date of the
task is not in the current month then I have to navigate to the correct
month of the task to see the highlighted date.

Shouldn't the calendar control change to the correct month and
highlight the selected date before rendering the control? If not then
does anyone have any idea how I can ensure that the calendar control is
showing the correct month for the required task?

Many thanks,

Jason.

Jul 2 '06 #1
2 2105
"Jason James" <ja***@dive-master.orgwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Shouldn't the calendar control change to the correct month and
highlight the selected date before rendering the control? If not then
does anyone have any idea how I can ensure that the calendar control is
showing the correct month for the required task?
Set the calendar's VisibleDate property first. See MSDN for further details.
Jul 2 '06 #2
Mark,

many thanks. Just what I was looking for.

Jason.

Jul 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Xarky | last post by:
Hi, I am using a calendar to show dates. Now I am setting my own date; myCalendar.SelectedDate = myDate; The date that is shown in the calendar is today's date. How can I move the calendar...
0
by: Luis Esteban Valencia | last post by:
Hi folks, I have a problem using the Calendar Control. Let me explain: On my first page, "Default.aspx", I have a calendar control named "calPrimary". I then have a Web User Control on the...
1
by: K B | last post by:
Hi, I have a calendar control inside an EditItemTemplate. All works great except when the date field in the db is Null. I get the 'cannot cast string to datetime type' error. I haven't...
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...
5
by: Victor Reboucas | last post by:
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...
3
by: i3enners | last post by:
Hello I am having problems with the ASP.Net calendar control. I have a style i apply to the selected date which works fine if i load the page then click on a date but when i set the selected date...
0
by: Nathan Sokalski | last post by:
I have a small form on my ASP.NET page that contains a Calendar control. I want to create a Reset button for the form using JavaScript. This is easy for controls that map directly to html tags,...
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...
1
by: ranger979 | last post by:
I am using the emptydatatemplate for a gridview control. I have a detailsview control within the emptydatatemplate. In the detailsview I have a templatefield that contains an imagebutton control...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.