Hiding folder structure for a view in SharePoint 2010 list definition

4.6k Views Asked by At

There's a setting on the "Edit View" page in SharePoint 2010 that allows you to show all items in a list, ignoring folder structure. The setting is under Folders > Folders or Flat > Show all items without folders. My question is:

Is there any way to enable this setting via an XML list definition created in Visual Studio 2010?

Is there any way to view the XML view defintion for an existing list so that I can dig out the appropriate XML tags/attributes? Where are these stored in SharePoint?

1

There are 1 best solutions below

3
On BEST ANSWER

Don't know the setting off by heart - but save the Document Library as a template (with the flat view as you require it) - download it locally and rename it to a .cab file - you can see the XML markup in the file contained. You should be able to easily find the markup for the view in the contained XML.

I've used this trick regularly when my schema.xml doesn't behave exactly as I want.

EDIT: I quickly did this and got the markup for a flat view. I think the attribute you're looking for is Scope="Recursive".

Best of luck, Shane