Change default view of Calendar


Would like to have the ability to change the default calendar view from Days to Years when it initially pops up. One real world scenario when this would be very important would be when using the calendar to select a birthdate. The year could be 1950 so it's not practical for someone to scroll back month by month, and users don't always understand they have to click the title twice to switch to year. Exposing a property like "InitialView" that could be set at design time or runtime would be ideal. The calendar would pop up right to year selection, then month, then day.

Additionally, being able to specify the starting date (or date range if specifying an initial view of years) would bring it all together.

FYI, another post regarding the issue exists at http://forums.asp.net/thread/1563831.aspx.

file attachments

Closed Jun 19, 2009 at 10:19 PM by
Issue is resolved with change set 54957. A new property has been introduced: DefaultView.


wrote Apr 14, 2007 at 1:03 AM

Ron - could you look into this? Thanks.

tguimond wrote Jun 14, 2007 at 1:26 AM

I am trying to achieve the very same thing. It would be excellent!

aboreham wrote Jun 14, 2007 at 2:19 AM

Please note that there is already a work item for this, submitted a lot time back!

tguimond wrote Jun 14, 2007 at 3:07 PM

Any chance of a link aboreham? I couldn't find it in the list. Cheers mate!

aboreham wrote Jul 3, 2007 at 6:30 AM

lug2100 wrote Aug 14, 2007 at 1:40 PM

we all waiting for the same ^_^

Tony wrote Aug 26, 2007 at 10:26 AM

I have added a CalendarMode property to the CalendarExtender control. It defaults to "Day", but can also accept "Month" and "Year". If you set the CalendarMode="Month" then it initially displays the month view of the control. You can drill up to year, and then back down to month. Once you select a month, it returns the results back to the associated textbox in the format specified. So if your format="MM/yyyy" then it will return 08/2007 when you select that month. I have submitted my patch. I have posted an explanation and some code to http://tonesdotnetblog.wordpress.com

hallem wrote Sep 17, 2007 at 6:56 PM

I modified the code that was posed at http://tonesdotnetblog.wordpress.com to just be able to change the initial view of the calendar from Day view to Month or Year view. The code at that site returns when you make a Month or Year selection in the respective modes where as mine does not return until you actually select a day. I have attached the files.

hkierjh wrote Sep 21, 2007 at 10:18 PM

This should go hand-in-hand with the (yet-to-be-implemented) "VisibleDate" property. If you want to select a date of birth, it should default to the year view but ALSO allow the first year (the one in the top left hand corner) to be customizable. This would work if the VisibleDate property was ALSO implemented with this property. See this work item:http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=12784

wrote Mar 17, 2009 at 6:50 AM

8259 is a duplicate of this (25 votes)

rtpHarry wrote Oct 2, 2009 at 10:17 PM

To celebrate this work item being closed I have written a blog post and provided a usage sample download: