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.CollapseValue(Boolean, Object[]) Method

Collapses a specific column or row that is identified by the specified values.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.2.dll

NuGet Package: DevExpress.Win.PivotGrid

#Declaration

public void CollapseValue(
    bool isColumn,
    object[] values
)

#Parameters

Name Type Description
isColumn Boolean

true to collapse a column; false to collapse a row.

values Object[]

An array of values that identify the column/row to be collapsed.

#Remarks

To collapse a column or row asynchronously, use the PivotGridControl.CollapseValueAsync method.

To expand a column or row, use the PivotGridControl.ExpandValueAsync (asynchronous) or PivotGridControl.ExpandValue (synchronous) method.

Consider the following PivotGrid control:

CollapseValue_method

To collapse the “Austria” column (within the “Alice Mutton” column), use the following code:

pivotGridControl1.CollapseValue(true, new object[] {"Alice Mutton", "Austria"});

The result of this operation is shown below:

CollapseValue_method_res

See Also