Skip to main content

PivotGridControl.ExpandValueAsync(Boolean, Object[]) Method

Expands the specified column or row asynchronously.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public Task<bool> ExpandValueAsync(
    bool isColumn,
    object[] values
)

Parameters

Name Type Description
isColumn Boolean

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

values Object[]

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

Returns

Type Description
Task<Boolean>

An asynchronous operation that returns true in case of success.

Remarks

The ExpandValueAsync method is asynchronous. ExpandValueAsync starts to execute the related operation in a background thread, and returns the Pivot Grid control. The main UI thread remains unblocked to allow the application to continue responding to user actions. Refer to the following topic for more information: Asynchronous Mode.

The image below shows the Pivot Grid with the collapsed “Austria” column.

CollapseValue_method_res

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

using DevExpress.XtraPivotGrid;
using System.Windows.Forms;
namespace WindowsFormsApp2 {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            pivotGridControl1.OptionsBehavior.UseAsyncMode = true;
            ConfigureLayout();
        }
        async void ConfigureLayout() {
            await pivotGridControl1.ExpandValueAsync(true, new object[] {"Alice Mutton", "Austria"});
        }
    }
}

The result of this operation is shown below:

CollapseValue_method

Use the PivotGridControl.ExpandValue method to expand a column or row synchronously.

To collapse a column or row, use the PivotGridControl.CollapseValueAsync (asynchronous) or PivotGridControl.CollapseValue (synchronous) method.

See Also