Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

PivotFieldReferenceCollection.InsertValuesReference(Int32) Method

Inserts the virtual “Values” field into the collection at the specified index.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

PivotFieldReference InsertValuesReference(
    int index
)

Parameters

Name Type Description
index Int32

A zero-based integer which specifies the position at which the “Values” field should be inserted. If it is negative or exceeds the number of elements within the collection, an exception is raised.

Returns

Type Description
PivotFieldReference

A PivotFieldReference object which represents a reference to the inserted “Values” field.

Remarks

Use the InsertValuesReference method to add the virtual “Values” field to the PivotTable.ColumnFields or PivotTable.RowFields collection at the specified position. The “Values” field automatically appears in a pivot table with more than one field in the data area and is used to specify the orientation of multiple data fields in the report. By default, the “Values” field is added to the end of the PivotTable.ColumnFields collection, so that multiple data fields are displayed across the columns, as shown in the image below.

PivotTable_ValuesField

You can also change the “Values” field’s position within the column or row area using the MoveDown, MoveUp, MoveToBeginning or MoveToEnd method of the PivotFieldReference object representing a reference to the “Values” field in the report. To determine whether the specified PivotFieldReference is the “Values” field, use the PivotFieldReference.IsValuesReference property.

See Also