SPRegionalSettings.ShowWeeks Property
Gets or sets a Boolean value that specifies whether to display the week number in day or week views of a calendar.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
The following code example sets the calendar type to Gregorian and enables display of the week number.
using (SPSite oSiteCollection = new SPSite("http://localhost")) { using (SPWeb oWebsiteRoot = oSiteCollection.RootWeb) { SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings; oRegionalSettings.CalendarType = 0; oRegionalSettings.ShowWeeks = true; oWebsiteRoot.Update(); } }
Note |
|---|
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects. |
Note