Set Properties on a List View Web Part…

Hey buddies. Smile Ever wanted to set some properties on a List View Web Part? Had issues doing it? End up with no solution? Here you have the solution.

Recent past I had a requirement to create a page instance with a Calendar Month view embed in a web part zone. So my first thoughts was to create a page manually, add the required calendar View to it, set all custom properties (hide chrome is the only thing I had to do) and export. Oh Gosh, at the last step I realized you cannot export the Calendar View Sad smile.

Any how reading through the net I found a way to export the Calendar List View. But it contains some GUIDs that refers to the Default View of the calendar, that is created when the web part is provisioned and that I cannot predict before hand. Now what?

Then reading some more articles on the web I found there is a way to set web part properties inside a CDATA section of the view. The Views are generated from the Microsoft.SharePoint.WebPartPages.ListViewWebPart.

 <View List="Lists/PluginCalendar" BaseViewID="2" Type="CALENDAR"
       Scope="Recursive" RecurrenceRowset="TRUE" WebPartZoneID="TopWebZone"
         <WebPart xmlns="">
             <Assembly>Microsoft.SharePoint, Version=, Culture=neutral,
             <Title>Calendar of Events</Title>

So finally I was able to set the web part properties inside a CDATA section and get the thing done. Smile


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s