Calendar Extendar - How to display Month Selection as default.

Last post 06-11-2009 11:13 PM by musashikyo001. 4 replies.

Sort Posts:

  • Calendar Extendar - How to display Month Selection as default.

    05-31-2009, 1:34 PM

    Hi I searched through the forum but I could not find an answer.

    Okay as you know if you click on the top heading on the calendar extendar it switching from showing you days to showing you month.

    Then if you click the top header again it switches to Year view etc etc.

    What I want to do is when the Calendar pops up it should be in the Month selection by default.

    Any pointers or help is greatly appreciated!! thanks.

  • Re: Calendar Extendar - How to display Month Selection as default.

    06-01-2009, 6:16 AM
    • Participant
      1,249 point Participant
    • svmr
    • Member since 10-06-2006, 2:34 AM
    • Singapore
    • Posts 217
    Hi Musashikyo,

    Have you downloaded the source of the AjaxControlToolkit that you are using? If not, you have to download that and modify the CalendarBehavior.js and then recompile and use it.

    I suppose to post here the code of CalendarBehavior.js but it has 1600+ lines. In the version of AjaxControlToolkit that I'm using at line 70 of CalendarBehavior.js it has this:

    this._mode = "days";

    You have to change the value with this:

    this._mode = "months";

    and recompile it. Use the recompiled AjaxControlToolkit.dll and every calendarextender that you used will be in Month Mode view. Or I'm giving option if you want I can give you the updated DLL that works for VS 2005 (.Net 2.0)???

    I hope it solves your problem.

    Thanks & Regards,
    Shier Vermont Morada REYES
    Systems Analyst


    NOTE: Remember to click 'Mark As Answer' on the post that helps you.
  • Re: Calendar Extendar - How to display Month Selection as default.

    06-02-2009, 3:19 AM
    Answer

    Hi,

    You can define Calendar Shown client event and set the mode as below.

        function onCalendarShown(sender,args)
        {   
            sender._switchMode("years", true);  
            sender._switchMode("months", true);
     
        }


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Calendar Extendar - How to display Month Selection as default.

    06-02-2009, 3:47 AM
    Answer
    • Participant
      1,249 point Participant
    • svmr
    • Member since 10-06-2006, 2:34 AM
    • Singapore
    • Posts 217

    Hi Vince,

    I have tried, this works great. Thanks Vince, you gave me an idea also.

    sender._switchMode("days", true); // for showing Day View calendar
    sender._switchMode("months", true); // for showing Month View calendar
    sender._switchMode("years", true); // for showing Year View calendar

    Musashikyo, to implement this in a Calendar Extender, add this property: OnClientShown="onCalendarShown"

    Thanks a lot Vince.

    Thanks & Regards,
    Shier Vermont Morada REYES
    Systems Analyst


    NOTE: Remember to click 'Mark As Answer' on the post that helps you.
  • Re: Calendar Extendar - How to display Month Selection as default.

    06-11-2009, 11:13 PM
    Thanks Shier and Vince your replies were off great help. I am really sorry for not getting back sooner as I was on vacation. This did solve my problem! Regards, Kyo
Page 1 of 1 (5 items)