PivotGridCells.SetSelectionByFieldValues(Boolean, Object[]) Method
Selects cells that reside within the specified column or row.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.1.dll
NuGet Package: DevExpress.Win.PivotGrid
Declaration
Parameters
Name | Type | Description |
---|---|---|
isColumn | Boolean | true to select cells within a column; false to select cells within a row. |
values | Object[] | An array of field values that identifies the column or row that should be selected. |
Remarks
If the specified field value array identifies several columns, the SetSelectionByFieldValues method selects all of them.
Use the null (Nothing in Visual Basic) value to identify the Grand Total column or row.
Consider the following pivot grid.
The table below demonstrates how to use the SetSelectionByFieldValues method to select columns and rows.
C# | Visual Basic | Selected Column(s) |
---|---|---|
pivotGridControl.Cells.SetSelectionByFieldValues(true, new object[] {1995}); |
pivotGridControl.Cells.SetSelectionByFieldValues(True, New Object() {1995}) |
0 - 2 |
pivotGridControl.Cells.SetSelectionByFieldValues(true, new object[] {1995, "Beverages"}); |
pivotGridControl.Cells.SetSelectionByFieldValues(True, New Object() {1995, "Beverages"}) |
0 |
pivotGridControl.Cells.SetSelectionByFieldValues(true, new object[] {1995, "Condiments"}); |
pivotGridControl.Cells.SetSelectionByFieldValues(True, New Object() {1995, "Condiments"}) |
1 |
pivotGridControl.Cells.SetSelectionByFieldValues(true, new object[] {1996}); |
pivotGridControl.Cells.SetSelectionByFieldValues(True, New Object() {1996}) |
3 |
pivotGridControl.Cells.SetSelectionByFieldValues(true, new object[] {null}); |
pivotGridControl.Cells.SetSelectionByFieldValues(True, New Object() {Nothing}) |
4 |
To select a column or row identified by a specific data field, use another overload of the SetSelectionByFieldValues method that takes a dataField parameter.