Hi, I have a grid binded to a DataTable wich shows
Prod Qtt Price Total
(Price*Qtt)
Is there any way the last line/last column be generated automatically with
the sum of the total column? Or should it be done manually with some loop
and variables?
Thanks!
Mark Rae [MVP] - 19 May 2008 16:05 GMT
> Hi, I have a grid (binded) bound to a DataTable wich shows
> Is there any way the last line/last column be generated automatically with
> the sum of the total column? Or should it be done manually with some loop
> and variables?
Google is your friend:
http://www.google.co.uk/search?sourceid=navclient&hl=en-GB&ie=UTF-8&rlz=1T4GZEZ_
en-GBGB252GB252&q=GridView+Totals+row

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
David Wier - 19 May 2008 16:31 GMT
check this out:
http://www.aspnet101.com/aspnet101/aspnet/codesample.aspx?code=GVFooterTotal
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
> Hi, I have a grid binded to a DataTable wich shows
>
[quoted text clipped - 6 lines]
>
> Thanks!
kelly goff - 19 May 2008 16:36 GMT
You could do the calculation in the query which pulls the table or
create a view which performs the calculation and pull from the view.
Kelly
> Hi, I have a grid binded to a DataTable wich shows
>
[quoted text clipped - 6 lines]
>
> Thanks!
David Wier - 19 May 2008 17:48 GMT
That would be fine, if there's non conditional clause, in the rowDatabound
event, affecting the full number of viewed records
However, with any clauses, the row databound event would be a preferable
scenario
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
> You could do the calculation in the query which pulls the table or
> create a view which performs the calculation and pull from the view.
[quoted text clipped - 11 lines]
>>
>> Thanks!