views:

947

answers:

2

I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowDataBound event, but don't know how to go about manually adding the additional two rows to the gridview. Any help much appreciated.

+1  A: 

You can use the Footer just like you use Headers in gridview.. whereas another solution is use a query in such way:

query 1 : ur original qry

UNION

query 2 : ur query which contains sum

(This applies only if you dont apply paging to ur grid)

Samiksha
+1  A: 
eed3si9n
Yeah, i think i'll have to go with the idea to stuff the additional two rows into the IList. Not ideal, but it'll suffice. Thanks.