473,715 Members | 2,972 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 6696
"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 "selectedit em" - 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.Visibl eDate

-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(objec t sender, EventArgs e)
{
Label1.Text = Calendar1.Visib leDate.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****@NOSPAMd evelop.com>
???????:b8***** *************** ******@msnews.m icrosoft.com...
Calendar.Visibl eDate

-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.gbl...
"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 "selectedit em" - 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
3622
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 month year table will carry around 2 - 3 Lac records and most of the time the operations will
3
5871
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
2065
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
3528
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 repopulate with all the invoices due in July. Here is the code I have thus far in trying to get those...
0
1547
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 selected. but i want to select the first(day) part of the dtp whenever i come for new entry. otherwise...
3
35710
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
8283
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
3236
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 value=2006>2006</option> </select>
7
6051
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
9340
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9103
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7973
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.