ApplyStyle Method
The ApplyStyle method of the SPView class applies the specified style to the view.
Parameters
viewStyle A Microsoft.SharePoint.SPViewStyle object that represents the view style.
Remarks
The ApplyStyle method requires that the Update method be called for changes to take effect in the database.
The following table shows the IDs and names of view styles that are included in the original installation of Microsoft Windows SharePoint Services.
Value | Description |
---|---|
0 | Basic Table |
6 | Picture Library Details |
7 | Daily (calendar view) |
8 | Weekly (calendar view) |
9 | Monthly (calendar view) |
12 | Boxed, no labels |
13 | Boxed |
14 | Document Details |
15 | Newsletter |
16 | Newsletter, no lines |
17 | Shaded |
18 | Issues Boxed |
19 | Issues Boxed, no labels |
Example
The following example applies a Boxed style to the All Items view for a specified list in a site of the current site collection.
This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.
Requirements
Platforms: Microsoft Windows Server 2003
Security: Code Access Security