I can create a calendar view in code, however I have as yet been unable to figure out how to change the "Default Scope" (this is the name that appears in the user interface when editing a calendar view). The options in the user interface are Day, Week, or Month - Month being the default. I'd like to be able to change the default to something else, Week for example, but I cannot figure out how to do it, other than using the user interface.
3 Answers
Try;
calView = new SPCalendarView();
calView.ViewType = "week";
-
1I've seen that, but as far as I can tell that only relates to adding a view to a web part? If I have access to the SPView object, how do I then use your code?– ZarekCommented Aug 17, 2010 at 16:14
You can't do it through API. By sending RPC call to owssvr.dll is the only other way other than UI. For complete solution, visit this link -
http://www.manvir.net/change-the-default-scope-of-sharepoint-calendar-view-to-week/
-
1While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines. Also we require disclosure of any affiliation with products or websites. Please see May I promote products or websites I am affiliated with here? for guidelines.– SPDoctorCommented Apr 25, 2013 at 8:20