PivotGridControl.GetRowIndex(Object[]) Method

Returns the index of the specified row.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

public int GetRowIndex(
    object[] values
)
Public Function GetRowIndex(
    values As Object()
) As Integer

Parameters

Name Type Description
values Object[]

An array of row field values that identify a row.

Returns

Type Description
Int32

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

Remarks

Pivot Grid rows are indexed as shown below:

GetRowIndex

If the field value array identifies several rows (this may happen if there are several data fields and the Area option is set to the RowArea value), the GetRowIndex method returns the smallest index. To get the row related to another data field, use the GetRowIndex(Object[], PivotGridField) method overload that allows you to specify a data field.

The following table demonstrates how to get row indices.

C# Visual Basic Return Value
pivotGridControl.GetRowIndex(new object[] {"Beverages", "Chang"}) pivotGridControl.GetRowIndex(New Object() {"Beverages", "Chang"}) 0
pivotGridControl.GetRowIndex(new object[] {"Beverages"}); pivotGridControl.GetRowIndex(New Object() {"Beverages"}) 5
pivotGridControl.GetRowIndex(new object[] {}); pivotGridControl.GetRowIndex(New Object() {}) 10

Note that the the method requires the field values, which may be different from the displayed text. The grand total columns has null values.

TIP

To display field values instead of automatically created and formatted strings, handle the FieldValueDisplayText event.

See Also