locked
Set Calendar Scope to Month RRS feed

  • Question

  • Hi,

    When a user clicks a day on the Calendar the view changes to Day scope.

    How can I ensure it always stays as Month scope?

    Thanks

    Tried below...

    using (SPWeb web = SPContext.Current.Web)
                {
                    web.AllowUnsafeUpdates = true;
                    SPList list = web.Lists["Calendar"];
                    if (list != null)
                    {
                        list.DefaultView = "Month";
                    }
                }

    Thursday, December 6, 2012 4:25 PM

Answers

  • I want to do this in code. So when the user clicks on a day it will remain in month view.

    Is this possible?

    just append "?CalendarPeriod=week" in to the calendar URL, this will automatically render in month view.

    -------------------------------------------------------------------
    If my post is helpful, Please vote!

    If you think my solution worked for you, Please mark as Anwser!

    Thanks.

    • Proposed as answer by Emir Liu Monday, December 10, 2012 3:07 AM
    • Marked as answer by Emir Liu Thursday, December 13, 2012 11:13 AM
    Friday, December 7, 2012 3:15 PM

All replies

  • Hi,

    1. Navigate to your calendar

    2.  Edit Calendar View

    3. Change the Default Scope -- > Month

    -------------------------------------------------------------------
    If my post is helpful, Please vote!

    If you think my solution worked for you, Please mark as Anwser!

    Thanks.

    Thursday, December 6, 2012 5:14 PM
  • I want to do this in code. So when the user clicks on a day it will remain in month view.

    Is this possible?

    Friday, December 7, 2012 9:41 AM
  • Please refer to the following post, hope it helps

    http://www.dotnetprodigy.com/2008/07/how-to-change-default-viewstyle-of.html

    http://www.sharepoint-answers.com/microsoft/Sharepoint-Windows-Services/30706916/how-to-change-calendar-view-default-scope-.aspx


    --Cheers

    Friday, December 7, 2012 11:10 AM
  • I want to do this in code. So when the user clicks on a day it will remain in month view.

    Is this possible?

    just append "?CalendarPeriod=week" in to the calendar URL, this will automatically render in month view.

    -------------------------------------------------------------------
    If my post is helpful, Please vote!

    If you think my solution worked for you, Please mark as Anwser!

    Thanks.

    • Proposed as answer by Emir Liu Monday, December 10, 2012 3:07 AM
    • Marked as answer by Emir Liu Thursday, December 13, 2012 11:13 AM
    Friday, December 7, 2012 3:15 PM