If you need a collection containing both list items and list folders, pass an SPQuery to the SPList.GetItems method. On the SPQuery object, set the ViewAttributes to “Scope=RecursiveAll” to get both folders and items from a list:
SPQuery q = new SPQuery();
q.ViewAttributes = “Scope=\”RecursiveAll\”";
SPListItemCollection listItems = list.GetItems(q);
Posted under Developer
This post was written by spotd on May 14, 2009


