Editing SPView objects

SharePoint Short #14

Making a change to a SPView object directly will not work:

listObject.DefaultView.Title = "new title";
listObject.DefaultView.Update();

What you should do is instantiate a new variable from the view you want to make changes to:

SPView view = listObject.DefaultView;
view.Title = "new title";
view.Update();
This entry was posted in SharePoint Shorts and tagged . Bookmark the permalink.
0 0 votes
Article Rating
Subscribe
Notify of
guest

Solve the maths problem shown below before posting: *

0 Comments
Inline Feedbacks
View all comments