views:

29

answers:

0

I have a gridview bound to a linq datasource and I would like to provide statistics about the gridview, such as you have 10 rows, 5 are of this type column and 5 are of this type, etc.

Is there an easy way to get the linq query out of the linq datasource? I can access the where clause and the parameters, but I don't know how to transform that into something I can use in a

var stuff = from c in db.table1

Then do a "DISTINCT" on a column to get the values, then tell how many rows are of each value.