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

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 6665
"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
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...
3
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...
2
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
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...
0
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...
3
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
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...
6
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...
7
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
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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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: 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...

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.