Skip to main content

PivotGridControl.ChangeFieldExpandedAsync(PivotGridField, Boolean) Method

Expands or collapses all values of the specified field asynchronously.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public Task<bool> ChangeFieldExpandedAsync(
    PivotGridField field,
    bool expand
)

Parameters

Name Type Description
field PivotGridField

A PivotGridField object that specifies the field whose values should be expanded/collapsed.

expand Boolean

true to expand field values; false to collapse them.

Returns

Type Description
Task<Boolean>

An asynchronous operation that returns true in case of success.

Remarks

The ChangeFieldExpandedAsync method is asynchronous. It starts executing the related operation in a background thread, and immediately returns control. The primary UI thread is not blocked, allowing the application to continue responding to end-user actions. For more information about the asynchronous mode, see Asynchronous Mode.

If you need to perform specific actions after the background operation is completed, use another overload of the ChangeFieldExpandedAsync method that takes the asyncCompleted parameter, and pass a delegate that performs the required actions as this parameter.

To collapse or expand all values of a particular field synchronously, use the PivotGridField.CollapseAll and PivotGridField.ExpandAll methods, respectively.

To collapse or expand a specific field value, use the PivotGridControl.CollapseValueAsync and PivotGridControl.ExpandValueAsync methods, respectively (or the PivotGridControl.CollapseValue and PivotGridControl.ExpandValue methods, to do this synchronously).

Field values can be collapsed and expanded by end-users, if the field’s PivotGridField.AllowExpand property is set to true.

See Also