Share via


SPFolderHierarchy.ListHasFolders method

Checks whether the list has folders.

Namespace:  Microsoft.Office.Server.Utilities
Assembly:  Microsoft.Office.Server (in Microsoft.Office.Server.dll)

Syntax

'Declaration
Public Shared Function ListHasFolders ( _
    list As SPList _
) As Boolean
'Usage
Dim list As SPList
Dim returnValue As Boolean

returnValue = SPFolderHierarchy.ListHasFolders(list)
public static bool ListHasFolders(
    SPList list
)

Parameters

Return value

Type: System.Boolean
true if the list has folders other than list.RootFolder; otherwise, false.
Returns Boolean.

Remarks

If folder.Properties has not previously been accessed, this method will cause an efficient query to be performed. Otherwise, no additional query is performed. The collection of subfolders is not queried to get the count.

See also

Reference

SPFolderHierarchy class

SPFolderHierarchy members

Microsoft.Office.Server.Utilities namespace