Skip to main content
All docs
V23.2

PivotGridField.GetAvailableValuesAsync() Method

Asynchronously returns a list of field values that are not excluded by filters applied to other fields and can be displayed.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public Task<object[]> GetAvailableValuesAsync()

Returns

Type Description
Task<Object[]>

An asynchronous operation that returns a list of field values as a result.

Remarks

The GetAvailableValuesAsync 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.

A list of available field values (an array of Object) is passed to the asyncCompleted delegate via the result parameter. This parameter returns an AsyncOperationResult instance. Use the AsyncOperationResult.Value property to obtain the list of field values.

Assume that a pivot grid contains two dimension fields: Category Name and Product Name.

ShowOnlyAvailableItems_PivotGrid

If there is no filtering applied to the Category Name field, the GetAvailableValuesAsync method called for the Product Name field will return all unique field values, since all of them can be displayed.

If the Category Name field has a filter that allows displaying only the Beverages category, the GetAvailableValuesAsync method called for the Product Name field will return only products related to the Beverages category, since all other products are excluded by the category filtering.

To obtain a list of available field values synchronously, use the PivotGridField.GetAvailableValues method.

PivotGridControl also allows you to remove field values that cannot be displayed from filter drop-down lists. To do this, use the PivotGridControl.ShowOnlyAvailableFilterItems property.

Note

If the PivotGridControl filters data by OLAP member unique names (controlled by the PivotGridField.OlapFilterByUniqueName and PivotGridControl.OlapFilterByUniqueName options), the GetAvailableValuesAsync method returns them instead of field values.

See Also