Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

Total items

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulo - 19 May 2008 15:42 GMT
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!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.