This is a migrated thread and some comments may be shown as answers.

CountFunction not returning unique count (DISTINCT)

1 Answer 239 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Graves
Top achievements
Rank 1
Brian Graves asked on 21 May 2010, 02:34 AM
I am attaching aggregation functions to my RadGridView columns.  However, when I use the CountFunction, it simply returns the number of rows in my grid.  I was hoping that it would return the sum of all UNIQUE values in my Column.  I tried to implement the code shown here but it won't compile (or work) with a Silverlight app:
http://www.telerik.com/support/kb/reporting/designing-reports/implementing-and-using-custom-aggregate-functions.aspx

Is there a way to do a DISTINCT count using the CountFunction?  If not, how can I programmatically bind a function to my column that will return the number of unique values?

1 Answer, 1 is accepted

Sort by
0
Brian Graves
Top achievements
Rank 1
answered on 22 May 2010, 01:06 AM
I found a way to do this using a custom EnumerableAggregateFunction class.  Unforunately, I found that I needed to create a different aggregation method for every single field in my grid (that I need to do a distinct count on).  Since I couldn't find a way to pass a string to the aggregate method (so I know which column that I want to do a distinct sum on), I ended up using the EnumerableSelectorAggregateFunction class.  See link:
http://www.telerik.com/community/forums/silverlight/gridview/footer-sum-of-one-or-more-fields.aspx
Tags
GridView
Asked by
Brian Graves
Top achievements
Rank 1
Answers by
Brian Graves
Top achievements
Rank 1
Share this question
or