PivotGridFieldBase.GetUniqueValues() Method
Returns an array of the unique values which are stored in the underlying data source in the current field.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.PivotGrid.v24.1.Core.dll
NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
Declaration
Returns
Type | Description |
---|---|
Object[] | An array containing the unique values in the current field. |
Remarks
This method traverses through the rows in the underlying data source and fetches unique values in the corresponding field. This field is identified by the PivotGridFieldBase.FieldName property. The method’s result is an array of the unique values.
For instance, you can use the GetUniqueValues method to get an array of all the values and then apply filtering using these values (select which ones should or shouldn’t be displayed). To apply filter criteria use the PivotGridFieldBase.FilterValues collection.
Note
If the PivotGridControl filters data by OLAP member unique names (controlled by the PivotGridFieldOptions.OLAPFilterByUniqueName and PivotGridOptionsOLAP.FilterByUniqueName options), the GetUniqueValues method returns them instead of field values.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetUniqueValues() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.