SPList.ItemCount Property

Gets the number of items in the list, including folders.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableAttribute> _
<ClientCallableConstraintAttribute(Type := ClientCallableConstraintType.Custom, FixedId := "a", Value := "It MUST be a greater than or equal to zero.")> _
Public ReadOnly Property ItemCount As Integer
    Get
'Usage
Dim instance As SPList
Dim value As Integer

value = instance.ItemCount
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.Custom, FixedId = "a", Value = "It MUST be a greater than or equal to zero.")]
public int ItemCount { get; }

Property Value

Type: System.Int32
A 32-bit integer that indicates the number of items, including folders.

Remarks

The value of the ItemCount property includes folders within a document library, as well as files within subfolders. The value of the Count property of the SPListCollection class does not include folders.

See Also

Reference

SPList Class

SPList Members

Microsoft.SharePoint Namespace