Share via


SPViewCollection class

Represents a collection of SPView objects.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.SPViewCollection

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

Syntax

'Declaration
Public Class SPViewCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPViewCollection
public class SPViewCollection : SPBaseCollection

Remarks

Use the Views property of either the SPList or SPView class to return the collection of views for a list or the parent collection of views for a view. Use an indexer to return a single view from a collection of views. For example, if the collection is assigned to a variable named collViews, use collViews[index] in C#, or collViews(index) in Visual Basic, where index is the index number of the view in the collection, the name of the view, or the GUID for the view.

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

SPViewCollection members

Microsoft.SharePoint namespace