Test For Flat Folder Structure In SharePoint Document Library

This example shows you how to return a boolean value if there is a flat folder structure present.

[csharp]

public static bool ViewHasFlatFolderStructure(SPView view)
{
        bool flagTest = false;
        if (view != null)
        {
                flagTest = (view.Scope == SPViewScope.Recursive) | (view.Scope == SPViewScope.RecursiveAll);
        }
        return flagTest;
}

[/csharp]

Share

Leave a Reply

Your email address will not be published. Required fields are marked *