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" >
       <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">

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


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?

  • Thank you Matt, I changed it to 100 but still it chooses the default view of Calendar.
    – Medes
    Commented Apr 10, 2013 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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