473,520 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get the month and year of Calendar that current displaying

How can I get the month and year a calendar control current displaying?

My problem is I want to load a list of event to a calendar so that it
display difference style if there a event for a day.

My initial idea is load all events from database and store it in a
DataTable. In the DayRender event, loop thr the DataTable and see if it equal
to e.Day and alter the style if that is.

However when the event table is large, it hurt performance. So how get I
know what month and year the calendar control is current displaying, thus I
can only load the events of specified month and year only?

Thanks in advance.

Jason
Nov 23 '05 #1
4 6677
"Jason Chan" wrote ...
However when the event table is large, it hurt performance. So how get I
know what month and year the calendar control is current displaying, thus
I
can only load the events of specified month and year only?

Thanks in advance.


Hi Jason,

I'm not overly familiar with the calendar control, however, from memory,
cant you access the "selecteditem" - if so, you should be able to get the
date from that - thus breaking it up and getting the month and year...

Again not overly familiar with it - but that should work I think...

Regards

Rob
Nov 23 '05 #2
Calendar.VisibleDate

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I get the month and year a calendar control current
displaying?

My problem is I want to load a list of event to a calendar so that it
display difference style if there a event for a day.

My initial idea is load all events from database and store it in a
DataTable. In the DayRender event, loop thr the DataTable and see if
it equal to e.Day and alter the style if that is.

However when the event table is large, it hurt performance. So how get
I know what month and year the calendar control is current displaying,
thus I can only load the events of specified month and year only?

Thanks in advance.

Jason

Nov 23 '05 #3
It doesn't work, i have a test.aspx with a Label and a Calendar, with
following code

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Calendar1.VisibleDate.ToString();
}

The Label1 show "1/1/0001 0:00:00" when the page first loaded, currently
month/year is Nov, 2005
When I click the nextMonth link, Calendar current displaying Dec, 2005,
however the Label1 show "1/1/0001 0:00:00",
When I click the nextMonth again, The Calendar now is Jan, 2006, but the
Label is "1/12/2005 0:00:00"
Then I click prevMonth, The Calendar back to Dec 2005, the Label shows
"1/1/2006 0:00:00"

It seem the VisibleDate always keep the previous value, and initial
undefined when the page first load.
Anyone can explain the behavior?

Or how you guys implements a event calendar?

Thanks in advance

"Brock Allen" <ba****@NOSPAMdevelop.com>
???????:b8**************************@msnews.micros oft.com...
Calendar.VisibleDate

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I get the month and year a calendar control current
displaying?

My problem is I want to load a list of event to a calendar so that it
display difference style if there a event for a day.

My initial idea is load all events from database and store it in a
DataTable. In the DayRender event, loop thr the DataTable and see if
it equal to e.Day and alter the style if that is.

However when the event table is large, it hurt performance. So how get
I know what month and year the calendar control is current displaying,
thus I can only load the events of specified month and year only?

Thanks in advance.

Jason


Nov 23 '05 #4
This doesn;t work, since when the page first loaded, no date is selected.
"Rob Meade" <ku***************@edaem.bor> ¼¶¼g©ó¶l¥ó·s»D:eF**************@TK2MSFTNGP15.phx.g bl...
"Jason Chan" wrote ...
However when the event table is large, it hurt performance. So how get I
know what month and year the calendar control is current displaying, thus
I
can only load the events of specified month and year only?

Thanks in advance.


Hi Jason,

I'm not overly familiar with the calendar control, however, from memory,
cant you access the "selecteditem" - if so, you should be able to get the
date from that - thus breaking it up and getting the month and year...

Again not overly familiar with it - but that should work I think...

Regards

Rob

Nov 23 '05 #5

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

Similar topics

8
3611
by: Zero.NULL | last post by:
Hi, We are using Month-year tables to keep the history of long transaction of our application. For example: We capture the details of a certain action in table "TransDtls<CurrMonth><CurrYear>" (this month: TransDtls072005). This way tables keep growing. every month a new table gets created. We have done it because we estimated that every...
3
5854
by: Bob | last post by:
I wish to group data on a report by week, month and year. Crystal reports has this ability as a built in function. Is there a quick way to do this in Access97/2000 VBA reports ? Thank you in advance, Bob.
2
2055
by: ruca | last post by:
Hi, Can anyone tell where can I get a full year calendar (not only for current year) control? -- Programming ASP.NET with VB.NET Thank's (if you try to help me)
7
3516
by: tfsmag | last post by:
Okay, i have a datagrid that I want to populate with invoices that are due on the month shown on the calendar, so what i need to do is retrieve the current 'shown' month and create a couple of variables that allows me to set the beginning date and end date of my range for the query. This means when i click on July, the datagrid should...
0
1533
by: =?Utf-8?B?bW9oYW5yYWpfaw==?= | last post by:
Hi, how can we select the day/month/year component in a DateTimePicker control, while navigating between fields. i.e, when i gotfocus to the control, either day/month/year component to be selected programmatically, because, when i finish the data entry. and adding again another data. the last typed part (either day/month/year) gets...
3
35684
by: =?Utf-8?B?R3V5IENvaGVu?= | last post by:
Hello how do I get the day/month/year part of a date in vb.net? sample in vb6: day(13/10/2001) = 13 month(13/10/2001) = 10 year(13/10/2001) = 2001 Thanks Guy
2
8272
by: deepikashalini | last post by:
hi, Im storing Issue date in database. Issuedate stored as varchar. and then compare to Passing string date('03/06/2008') what is query to compare storing varchar date to passing string date. its only compare date only. not compare month,year. i want to compare date,month,year all things.
6
3227
by: olala123 | last post by:
i have created following drop down box for displaying year... i want to populate the drop down box upto current year.. and need to write a java script for this .. any pointers in this regard will be very helpful Code: ( text ) <select name=year> <option value=2008>2008</option> <option value=2007>2007</option> <option...
7
6039
by: kkshansid | last post by:
i want to display it in date/ month/ year format <td><?php echo date("d/m/y",($row)); ?></td> output 01/01/70 <td><?php echo $row; ?></td> output 1977-08-09
0
7216
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7448
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7175
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7573
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5754
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5135
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3289
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
842
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.