Back to Devexpress

PivotGridControl.SetSelectionByFieldValues(Boolean, Object[]) Method

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-dot-setselectionbyfieldvalues-x28-system-dot-boolean-system-dot-object-x29.md

latest3.0 KB
Original Source

PivotGridControl.SetSelectionByFieldValues(Boolean, Object[]) Method

Selects cells that reside within the specified column or row.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public void SetSelectionByFieldValues(
    bool isColumn,
    object[] values
)
vb
Public Sub SetSelectionByFieldValues(
    isColumn As Boolean,
    values As Object()
)

Parameters

NameTypeDescription
isColumnBoolean

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 BasicSelected Column(s)
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995});pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995})0 - 2
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995, 1});pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995, 1})0
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995, 2});pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995, 2})1
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1996});pivotGridControl.SetSelectionByFieldValues(True, New Object() {1996})3
pivotGridControl.SetSelectionByFieldValues(true, new object[] {null});pivotGridControl.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.

See Also

PivotGridControl Class

PivotGridControl Members

DevExpress.Xpf.PivotGrid Namespace