I would like to determine how many distinct values are shown in a grid column after filtering is applied.
The filter parameter (true) in grid.GetDistinctValues(column, true, null) considers the other columns (but not the specified column). So this method returns every distinct value for the considered column and is not restricted to just those distinct values that are actually shown in the column as a result of the filtering currently applied to that column as well as to the other columns.
So this method doesn't suit my purpose.
I would like to know the number of distinct values actually shown in a column to support the following two scenarios. (1) If there are zero distinct values displayed in a column, then the last filtering operation over-constrained the result set and can be undone (with user notification). (2) If there is only one distinct value, then the column can be hidden and the column-header/single-unique-value pair can be transferred to a "common values" grid.
This approach works well with our datasets. As the user applies filtering operations, an 8000 row, 65 column datasource typically gets reduced to about 20 rows and 5 to 10 columns each containing more than one distinct value. All other single-valued columns are displayed in an adjacent common-values grid.
In the grid.FilterDescriptors.CollectionChanged event, I invoke the method which consolidates the common-values. For this method, I need to know if there is only one distinct value.
Many thanks!
The filter parameter (true) in grid.GetDistinctValues(column, true, null) considers the other columns (but not the specified column). So this method returns every distinct value for the considered column and is not restricted to just those distinct values that are actually shown in the column as a result of the filtering currently applied to that column as well as to the other columns.
So this method doesn't suit my purpose.
I would like to know the number of distinct values actually shown in a column to support the following two scenarios. (1) If there are zero distinct values displayed in a column, then the last filtering operation over-constrained the result set and can be undone (with user notification). (2) If there is only one distinct value, then the column can be hidden and the column-header/single-unique-value pair can be transferred to a "common values" grid.
This approach works well with our datasets. As the user applies filtering operations, an 8000 row, 65 column datasource typically gets reduced to about 20 rows and 5 to 10 columns each containing more than one distinct value. All other single-valued columns are displayed in an adjacent common-values grid.
In the grid.FilterDescriptors.CollectionChanged event, I invoke the method which consolidates the common-values. For this method, I need to know if there is only one distinct value.
Many thanks!