SPListItem.FileSystemObjectType property

Gets or sets the file system object type for the item.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPFileSystemObjectType FileSystemObjectType { get; set; }

Property value

Type: Microsoft.SharePoint.SPFileSystemObjectType
An enumeration value that indicates the type: file, folder, Web, or invalid.


You can set this property only for a new list item. The current item is not new; it has already been persisted in the database.

It is only valid to set this property on new SPListItem objects—that is, before the Update method is called for the first time and the item is persisted in the database.