Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

programmatically create view - "Show all documents without folders"

  Asked By: Jody Holloway         Date: Apr 05, 2010      Category: Sharepoint      Views: 1416
 

I'm trying to programmatically create views against all our existing
document libraries that mirror what you would get if you selected "Show
all documents without folders" when editing a view through the UI.

Everything works fine apart from this, I just can't find a way of
setting it.
Any ideas?

Tagged:                

 

1 Answer Found

 
Answer #1       Answered By: Bijayani Baijayanti          Answered On: Jun 22, 2010       

Folders help group related items within a list. The code snippet provided below (in C#.Net) explains the approach of creating a folder within a specific list.
using (SPSite oSPsite = new SPSite("http://website_url"))
{
oSPsite.AllowUnsafeUpdates = true;

using (SPWeb oSPWeb = oSPsite.OpenWeb())
{
oSPWeb.AllowUnsafeUpdates = true;

/* Path within the list where the new folder gets created
Leave it empty if it needs to be created under root */

Thanks,
Bijayani
www.mindfiresolutions.com/Sharepoint-Support.htm

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].