SharePoint 2010 - Recursive Query in List/Library


CAML query is by default non recursive. If you execute a CAML query, you will end up with items from the list root folder.

You have to define extra query options as shown below in case you want to query all folders and sub folders within a list (Recursive Query) :

query.ViewAttributes = "Scope='Recursive'";



From:
http://blogs.technet.com/b/meacoex/archive/2010/10/24/recursive-and-folder-scoped-linq-queries-in-sharepoint-2010.aspx

Comments

Popular posts from this blog

Sharepoint 2010 - Filter List/Library Web Part with XSLT and Content Editor WP

Sharepoint 2010 - Multilanguage Site - Show column in current language

Sharepoint 2010 - Enable/Disable Ribbon Button with EcmaScript