Skip to main content
A newer version of this page is available. .

PivotGridControl.GetColumnIndex(Object[]) Method

Returns the index of the specified column.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v18.2.dll

Declaration

public int GetColumnIndex(
    object[] values
)

Parameters

Name Type Description
values Object[]

An array of column field values that identify the column.

Returns

Type Description
Int32

An integer value that specifies the column index. -1 if the specified column has not been not found.

Remarks

Pivot Grid columns are indexed as shown below:

GetColumnIndex

If the specified field value array identifies several columns, the GetColumnIndex method returns the smallest index.

The following table demonstrates how to use the GetColumnIndex method to obtain column indexes.

C# Visual Basic Return Value
pivotGridControl.GetColumnIndex(new object[] {1995}); pivotGridControl.GetColumnIndex(New Object() {1995}) 2
pivotGridControl.GetColumnIndex(new object[] {1995, "Beverages"}); pivotGridControl.GetColumnIndex(New Object() {1995, "Beverages"}) 0
pivotGridControl.GetColumnIndex(new object[] {1995, "Condiments"}); pivotGridControl.GetColumnIndex(New Object() {1995, "Condiments"}) 1

To obtain the index of a particular row, use the PivotGridControl.GetRowIndex method.

See Also