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 - Enable/Disable Ribbon Button with EcmaScript

Sharepoint 2010 - Customizing Quick Launch with pages

Sharepoint 2010 - Migrate List-based Workflows between Sites and Site Collections