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

SharePoint provides the ability to create a new view for any list by choosing a view type. For example, SP allows me to create a view of type calendar by specifying which columns defines the start date, end dates, label in the calendar view.

Is there any way to create a custom view type, that is not related to a specific list, but that I can reuse with any list by mapping the view properties and the list columns ?

thx

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I believe not. Those are hard-coded in the TEMPLATE\LAYOUTS\viewtype.aspx file. The only thing you can do it attach a view to a list. By creating a new view:

list.Views.Add("VIEWNAME", ALL THE FIELDS YOU WANT TO DISPLAY, Query, COUNT, true, false);
list.Update();

SPView view = list.Views["VIEWNAME"];

Now you can update the view properties

share|improve this answer
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.