How to create a Month View with the Ajax Control Toolkit Calendar Extender Control

I read a forum entry from Microsoft’s own Zhi-Qiang Ni on how to make a Month view calender extender. I have implemented his version, which shows a From and To date version.

Here’s what Zhi-Qiang Ni produced:

Ajax Control Toolkit Month Calendar

Ajax Control Toolkit Month Calendar

You can see the original forum article here:

http://forums.asp.net/t/1349086.aspx 

Showing Month/Year view is a common requirement, and I intend to evolve this version into something more generic.  Note that this version does not require patching the Ajax Control Toolkit – it is a stand alone javascript version that redirects the delegates to call local javascript functions.

The benefit here is that when the Ajax Control Toolkit changes, you won’t need to make modifications to the Ajax Control Toolkit source code to continue with these changes.

Zhi-Qiang Ni produced another version, here:

http://forums.asp.net/t/1342938.aspx

Month View version 2

Month View version 2

The code he has put in the click delegate is taken straight out of the calendar extender CalendarBehavior.js file _cell_onclick method and modified.

In the file I have created a 3rd sample. In that one, I have taken the above example and removed the Day/Year part of it, so that it shows month only. I have also removed the adding and removing of delegates from the onCalendarShown1 javascript function as I don’t think it’s necessary – there are always 12 months, the delegates are common and always containing the same data.

In the final sample, I take the calendar image from the Calendar Extender samples site and add it to the end of the extender, making it a Calendar Extender popup image.

So now the example looks like this:

Month View from Sample 4

Month View from Sample 4

You can download Zhi-Qiang Ni’s version implemented here with some minor tweaking and extra sample pages here:

http://cid-5e237543fffb2891.skydrive.live.com/self.aspx/Public/MonthCalendarPrettiedUpSample.zip

Thanks go to Microsoft’s Zhi-Qiang Ni for this version!

2 Responses to How to create a Month View with the Ajax Control Toolkit Calendar Extender Control

  1. […] Patching the Ajax Control Toolkit Calendar Extender control to show a Month or Year Edit: I have just implemented Zhi-Qiang’s version of the Month calendar view and made some minor adjustments. You can find it here: https://tonesdotnetblog.wordpress.com/2009/04/21/how-to-create-a-month-view-with-the-ajax-control-too… […]

  2. […] As long as computers have been around, there have been scenarios where selecting a date, a month, a year or some other timeframe has been necessary.  Zhi-Qiang Ni, from Microsoft, wrote a modification to display a month view of the control, so that a month and year can be selected using the Ajax Control Toolkit. I have implemented Zhi-Qiang’s version, which may be found here: https://tonesdotnetblog.wordpress.com/2009/04/21/how-to-create-a-month-view-with-the-ajax-control-too… […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: