Share via


Add(Microsoft.SharePoint.SPField) Method

The Add method of the SPViewFieldCollection class adds the specified field to the collection.

Parameters

field   A Microsoft.SharePoint.SPField object that represents the field.

Remarks

The Add method requires that the Update method of the SPView class be called for changes to take effect in the database.

Example

The following code example uses the Add method to make an existing field a view field for the specified list.

This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security