Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a Calendar list via Visual Studio 2012. I have added a new Custom View to the Schema.xml file and removed all other views. this calendar list deployed by a feature. I have a custom web template with a custom default.aspx file, this default.aspx file is deployed by a Module. within elements.xml of this Module I have added a view element which uses the calendar list as list view web part. When I create a site based on my web template everything works, but the calender uses the normal View (Calendar view) not my view, even I have deleted all other views. so I need to change the view manually. what must I do to make my view be chosen when you create a site based on my web template? following is a part of elements.xml and schema.xml files. elements.xml of the module which adds default.aspx

<View List="Lists/MyCalendar" BaseViewID="0" DefaultView="TRUE" RecurrenceRowset="TRUE" WebPartZoneID="peRow2Column3" WebPartOrder="0" >
    <![CDATA[
       <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">

schema.xml of MyCalendar list

  <View BaseViewID="0" Type="HTML" Name="371903AD-349D-45B2-B882-7C5DEE528C21" WebPartZoneID="peRow2Column3" DisplayName="my view" SetupPath="pages\viewpage.aspx" MobileDefaultView="TRUE" Url="CustomRendering.aspx"  DefaultView="TRUE">
    <ViewFields>
share|improve this question
add comment

2 Answers 2

Finally I found the answer for this problem.

I need to use XsltListViewWebPart instead of ListViewWebPart for the List View Web part in elements.xml

share|improve this answer
add comment

My assumption is that the BaseViewID is already being used by SharePoint for the default calendar list. Have you tried bumping that number up to something like 100 just to be safe?

share|improve this answer
    
Thank you Matt, I changed it to 100 but still it chooses the default view of Calendar. –  Medes Apr 10 '13 at 8:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.