SPListItem.SortType Property
Gets or sets the type of this item when sorting within a view.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Property SortType As SPFileSystemObjectType
Get
Set
'Usage
Dim instance As SPListItem
Dim value As SPFileSystemObjectType
value = instance.SortType
instance.SortType = value
public SPFileSystemObjectType SortType { get; set; }
Property Value
Type: Microsoft.SharePoint.SPFileSystemObjectType
An enumeration value that indicates the type.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | The item is an existing item. This property can be set only on a new item. |
ArgumentException | The value specified was SPFileSystemObjectType.Folder. That sort type is not supported. |
Remarks
The sort type can be set only on a new item. The only change from the default sort type that is supported applies SPFileSystemObjectType.File to folder list items, a change that causes folders to sort as if they were files.