SPViewCollection class
SharePoint 2013
Represents a collection of SPView objects.
System.Object
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.SPBaseCollection
Microsoft.SharePoint.SPViewCollection
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.SPBaseCollection
Microsoft.SharePoint.SPViewCollection
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[SubsetCallableTypeAttribute] [ClientCallableTypeAttribute(Name = "ViewCollection", CollectionChildItemType = typeof(SPView), CollectionIndexerMethodClientName = "GetById", CollectionCreateEntityMethodClientName = "Create", ServerTypeId = "{03C5D7A9-9541-4482-9919-CA0CCCF565A0}", SampleUrl = "{apiroot}/web/lists({listid})/Views")] public class SPViewCollection : SPBaseCollection
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.