Share via


SPViewFieldCollection.MoveFieldTo method

Moves the specified field to the specified position in the collection of view fields.

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

Syntax

'Declaration
Public Sub MoveFieldTo ( _
    field As String, _
    index As Integer _
)
'Usage
Dim instance As SPViewFieldCollection
Dim field As String
Dim index As Integer

instance.MoveFieldTo(field, index)
public void MoveFieldTo(
    string field,
    int index
)

Parameters

  • field
    Type: System.String

    A string that contains the internal name of the field. You can get the name by accessing the InternalName property.

  • index
    Type: System.Int32

    The new position for the field in the collection of view fields. The first position is 0.

Exceptions

Exception Condition
ArgumentNullException

The argument passed to the field parameter is a null reference (Nothing in Visual Basic).

SPException

The field does not exist in the collection.

See also

Reference

SPViewFieldCollection class

SPViewFieldCollection members

Microsoft.SharePoint namespace