Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Totals in grid footer?

Reply
Thread Tools

Totals in grid footer?

 
 
SStory
Guest
Posts: n/a
 
      05-11-2004
Is there a way to show subtotals in the footer of a datagrid?

How?

Thanks,

Shane


 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      05-11-2004
> Is there a way to show subtotals in the footer of a datagrid?
>
> How?


Essentially you need to keep a running total, updating the running total
in the ItemDataBound event handler for each Item or AlternatingItem.
For the Footer, you need to programmatically insert this running total
value.

There's an article here that shows how to accomplish this and more:
http://aspnet.4guysfromrolla.com/articles/073003-1.aspx

Happy Programming!

--

Scott Mitchell
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
Reply With Quote
 
 
 
 
SoftLion
Guest
Posts: n/a
 
      05-12-2004
Or simply you can add a Table to your DataSet (it supports more than one
table/=result set/=query returned all in only one database roundtrip !) with
totals in it and modify the FooterItemTemplate of each item to display the
content of this second table.
This way you'll get the total correct even if pagination is turned on.

4GuysFromRolla rocks, thanks to you for your excellent datagrid's articles !
It's the best jump start I've found. Though you could improve the handling
of drop-downs (static) content by using the same technique as above.
What is missing is how to get a good user feeling when editing in a datagrid
: simulate smartnavigation while editing (add/delete/modify) the grid
content.

Benjamin.

"Scott Mitchell [MVP]" <(E-Mail Removed)> a écrit dans le message
de news:vx8oc.7245$(E-Mail Removed) m...
> > Is there a way to show subtotals in the footer of a datagrid?
> >
> > How?

>
> Essentially you need to keep a running total, updating the running total
> in the ItemDataBound event handler for each Item or AlternatingItem.
> For the Footer, you need to programmatically insert this running total
> value.
>
> There's an article here that shows how to accomplish this and more:
> http://aspnet.4guysfromrolla.com/articles/073003-1.aspx
>
> Happy Programming!
>
> --
>
> Scott Mitchell
> (E-Mail Removed)
> http://www.4GuysFromRolla.com
> http://www.ASPFAQs.com
> http://www.ASPMessageboard.com
>
> * When you think ASP, think 4GuysFromRolla.com!



 
Reply With Quote
 
Saravana [MVP]
Guest
Posts: n/a
 
      05-14-2004
Check out this article,
http://www.extremeexperts.com/Net/Ar...stoFooter.aspx


--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com



"SStory" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way to show subtotals in the footer of a datagrid?
>
> How?
>
> Thanks,
>
> Shane
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running totals in gridview (when you have many totals required) =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?= ASP .Net 3 02-16-2007 12:03 PM
Generating totals of grid on load Mike the Canadian Javascript 3 11-19-2005 03:06 AM
Error trying to get totals in footer ASP .Net 2 07-02-2004 05:42 PM
adding totals to grid Carlos ASP .Net Datagrid Control 2 06-11-2004 05:16 AM
totals at the top of a DataGrid? Gary ASP .Net 4 02-24-2004 01:14 AM



Advertisments