Data View Web Part, The Basics – Folders
Articles in this Series
- New Article Series: Laura Rogers on Data View Web Part Basics
- Data View Web Part, The Basics – Insert a DVWP on Your Page
- Data View Web Part, The Basics – Folders
- 3 Minute Screencast: Use DVWP to display all files, even those stored in folders!
Note: As a follow-up to this article, Laura has created a terrific screencast.
When creating data view web parts in SharePoint Designer, and dealing with libraries or lists that contain folders, the Item and Folder Scope setting becomes pretty important.
In SharePoint views, it’s always possible to create a new view of the list with no folders, by configuring the “Folders” section in your view settings. Unfortunately, the same functionality is not as obvious in SharePoint Designer. When you create a view with no folders, and then convert it to XSLT in SPD, the folders always reappear.
Here’s how to modify the way folders are enumerated in data view web parts (XSLT).
- Open this page in SP Designer, and click in a zone, and add a data view web part. Pick your list or library (one with folders in it).
- In the data source library pane on the right, click the drop-down on your library, and choose "Show data". Select the fields that you would like to be displayed, and click to insert them onto the page (you can just use a multiple item view at this point).
- When you’re in your data view in SPD, and you have the Data Source Details pane showing on the right, you’ll see "Current Data Source" at the top of that toolpane, and a link to open the details about that current data source.
- Open that link. There’s a drop-down box that says "Item and folder scope".
- Default only shows the top level of folders and files in the document library.
- Recursive shows all files in the library, with no folders
- RecursiveAll shows all files and folders in the library, in one list.
This is an example of a document library in a data view web part, with the item and folder scope set to Recursive:

In my next article, you’ll learn how to turn these document names into links to open the documents, as opposed to the default text only formatting.
Author: Laura Rogers, Birmingham, AL
Laura Rogers is currently a SharePoint Administrator at HealthSouth Corporation in Birmingham, Alabama. She has ten years of experience with Microsoft’s messaging and collaboration systems. This includes four years in SharePoint implementation, training, and customization. Laura has been a MCSE since 1999, with her most recent certifications being MCSE 2003 + Messaging, MCTS in MOSS and MCTS in WSS 3.0 Configuration. She also wrote a chapter in the Microsoft Office SharePoint Server 2007 Administrator’s Companion by Bill English.
- New Article Series: Laura Rogers on Data View Web Part Basics
- Data View Web Part, The Basics - Insert a DVWP on Your Page
- 6 Minute Screencast: Insert a Data View Web Part onto a SharePoint Page
- Data View Web Part, The Basics - Folders
- 3 Minute Screencast: Use DVWP to display all files, even those stored in folders!
- Data View Web Part, The Basics - Add a Hyperlink
- Data View Web Part, The Basics - Keep it Clean
- Data View Web Part, The Basics – Multiple Edit Forms
- 3 Minute Screencast: Data View Web Part, The Basics – Multiple Edit Forms
- Live Online Workshop - Data View Web Part Solutions: Part 2
- 5 Minute Screencast: SharePoint Web Services for Non-Developers
- 3 Minute Screencast: Merging SharePoint Document Libraries
- 2 Minute Screencast: Permissions Dashboard
- 4 Minute Screencast: Join View of SharePoint Lists
- Get it Together: Groups and Totals in the Data View Web Part (Screencast)
- SharePoint: Open Links in a New Browser Window (Screencast)
- How to Create a SharePoint Data View Web Part “Rollup” (Screencast)
- SharePoint: "New" Icon (Screencast)
- Display a SharePoint List on Another Site (Screencast)
- Customize the "no items" Display Text in SharePoint (Screencast)
- SharePoint: Displaying Calculated Column SUMS in a View (Screencast)
Wonderful stuff! Thanks!
Great content Laura. I built a dynamic active documents report from the info. I’m trying to add conditional format within it, so I can determine documents that are more than a year, or documents that meet their destruction dates. Do you have any insight with that? Specificaly: [Current Date]-360 as the condition. Thank you.
Hi – I’m trying to set the Recursive mode external data sources that are then used in a Linked data source. It forces me to make copy and modify the external data source library, which I then set to recursive. But trying to show details gives an unspecified error. Any thoughts on how to use this for external sources?
Thanks Laura!!!
You helped me so much with writing this post. During my project work in the last week I struggled with this question hows to generate a table of content page based on serveral subfolders within a Document Library.
With this tip “There’s a drop-down box that says “Item and folder scope” I can now enable a filter on a “Document Library” and based on a path folder cretaria show specic documents for that subfolder.
hi Laura,
i ma new to this blog,
i am working in sharepoint with 1 yr experience in asp.net(c#).
i have one doubt.that is
can we connect external datasource to dash boards to create barcharts in reporting services.
waiting for u r reply.
Babu