Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PivotGridControl.SetSelectionByFieldValues(Boolean, Object[], PivotGridField) Method

Selects cells that reside within the specified column or row, identified by the specified data field.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

#Declaration

public void SetSelectionByFieldValues(
    bool isColumn,
    object[] values,
    PivotGridField dataField
)

#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.

dataField PivotGridField

A PivotGridField object. Specifies a data field 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.

SetSelectionByFieldValues_DataFields

The table below demonstrates how to use the SetSelectionByFieldValues method to select columns and rows.

C# Visual Basic Selected Column(s)
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995, 1}, fieldUnitPrice); pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995, 1}, fieldUnitPrice) 0
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995, 1}, fieldQuantity); pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995, 1}, fieldQuantity) 3
pivotGridControl.SetSelectionByFieldValues(true, new object[] {1995}, fieldUnitPrice); pivotGridControl.SetSelectionByFieldValues(True, New Object() {1995}, fieldUnitPrice) 0 - 2
pivotGridControl.SetSelectionByFieldValues(true, new object[] {}, fieldQuantity); pivotGridControl.SetSelectionByFieldValues(True, New Object() {}, fieldQuantity) 3 - 5
pivotGridControl.SetSelectionByFieldValues(true, new object[] {null}, fieldQuantity); pivotGridControl.SetSelectionByFieldValues(True, New Object() {Nothing}, fieldQuantity) 7
See Also