SPViewFieldCollection class
Represents the collection of fields returned in a view.
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.SPBaseCollection
Microsoft.SharePoint.SPViewFieldCollection
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Use the ViewFields property of the SPQuery, SPView, or SPViewStyle class to return an SPViewFieldCollection object that represents the collection of view fields for a query, view, or view style. Use an indexer to return a single view field from the collection. For example, if the collection is assigned to a variable named collViewFields, use myViewFields[index] in C#, or myViewFields(index) in Visual Basic, where index is the index number of the field in the collection.
The following code example removes the Modified field from the specified view of an Announcements list and adds the Expires field to the view.
Note |
|---|
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects. |
Note