When you are customizing a SharePoint list with a custom schema.xml file, you may also want to set the ViewStyle for your View.
You do that by adding a <ViewStyle ID="xx"/> element within the <View> element. For exampl ID 17 corresponds to the "Shaded" view style.
Here’s a table with the common ViewStyles available, as defined in the <12 HIVE>\TEMPLATE\GLOBAL\XML\VWStyles.xml
|12||Boxed, no labels|
|16||Newsletter, no lines|
One thought to “SharePoint: How to apply ViewStyle in schema.xml”
About your post, i am developing a very little SharePoint features with powershell(and after on c#) who ensures 2 things :
1 – Toggle all GenericList views and all DocLibrary views on viewStyle “Shaded” when my feature is actived(Event Receiver).
$view.ApplyStyle($web.ViewStyles.StyleByID($intShaded)); //$inShaded = 17 of course ^^
2 – Toggle all GenericList views and all DocLibrary views on viewStyle on viewStyle Default when my feature is desactived(Event Receiver).
My question is simple. What is the integer value for “default” (StyleId) viewstyle ? It cannot be 0, because when i try to put 0, i have a “Basic Table” viewStyle that is different than “Default” styleID.
In advance, sorry for my english faults and thank you for your return.
Alexandre, from France.