SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


SPList.DefaultView  

Dec 152009

The SDK says: “An SPView object that represents the default view.”

But if you want to change e.g. the ViewFields from the default view, you cannot use SPList.DefaultView.ViewFields.Add(fieldname);

Instead use

SPView defaultView = list.Views[list.DefaultView.ID];
defaultView.ViewFields.Add(fieldname); // internal field name
defaultView.Update();

to modify the default view. It seems the DefaultView property cannot modify the View itself.

 
Posted by René Hézser | 2  Comments | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: SharePoint
Technorati Tags:

Links to this post

Comments

commented on  Saturday, December 26, 2009  3:14 PM  by  Rahul Chaurasi
First of all. Thanks very much for your useful post.

I just came across your blog and wanted to drop you a note telling you how impressed I was with the

information you have posted here.

Please let me introduce you some info related to this post and I hope that it is useful for community.

There is a good SharePoint resource site, Have alook

http://www.how 2sharepoint.com/

http://www.sha repoint2003.com/

http://share pointbank.com/

Thanks again
Rahul

commented on  Thursday, January 21, 2010  11:04 PM  by  Jason Venema
Just the information I needed. Thanks a lot!

Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation