Skip to main content

PivotGridFieldCollectionBase.SetFieldIndex(PivotGridFieldBase, Int32) Method

Sets the index of the specified field to the specified value.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v22.2.Core.dll

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Dashboard.Design


public void SetFieldIndex(
    PivotGridFieldBase field,
    int newIndex


Name Type Description
field PivotGridFieldBase

The PivotGridFieldBase object that should be moved to the specified location in the collection.

newIndex Int32

The new index of the specified field.


The index of a field in the collection is specified by the PivotGridFieldBase.IndexOf property. This property and the SetFieldIndex method can be used to move the field to a new position.

To specify the field’s visual position amongst the other fields within the same Area use the PivotGridFieldBase.AreaIndex property.

The SetFieldIndex method does nothing if the value of the newIndex parameter is less than 0 or greater than the number of the items in the collection.

See Also