wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-dot-getrowindex-x28-system-dot-object-x29.md
Returns the index of the specified row.
Namespace : DevExpress.Xpf.PivotGrid
Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll
NuGet Package : DevExpress.Wpf.PivotGrid
public int GetRowIndex(
params object[] values
)
Public Function GetRowIndex(
ParamArray values As Object()
) As Integer
| Name | Type | Description |
|---|---|---|
| values | Object[] |
An array of row field values that identify the row.
|
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the row index. -1 if the specified row has not been not found.
|
Pivot Grid columns and rows are indexed as shown below:
If the specified field value array identifies several rows, the GetRowIndex method returns the smallest index.
The following table demonstrates how to use the GetRowIndex method to obtain row indexes.
| Method Usage | Return Value |
|---|---|
pivotGridControl.GetRowIndex("UK") | 0 |
pivotGridControl.GetRowIndex("UK","Anne Dodsworth") | 1 |
pivotGridControl.GetRowIndex("UK","Michael Suyama") | 2 |
To obtain the index of a particular column, use the PivotGridControl.GetColumnIndex method.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetRowIndex(Object[]) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
{
int index = pivot.GetRowIndex(new object[] { null });
if (index != -1)
Private Sub pivot_CustomFieldValueCells(ByVal sender As Object, ByVal e As DevExpress.Xpf.PivotGrid.PivotCustomFieldValueCellsEventArgs)
Dim index As Integer = Me.pivot.GetRowIndex(New Object() {Nothing})
If index <> -1 Then e.Remove(e.GetCell(False, index))
See Also