subheaders with totals

I

igotyourdotnet

I have a gridview were i'm using subheaders, but now I want to add totals
for each 'subheader'.
First, is that possible to do, and second, can someone point me to an
example how this works?

My gridview looks like this:

BMW
1
2
total sales 55,000
Lexus
1
2
total sales 25,000
 
E

Eliyahu Goldin

The easiest way is to handle the PreRender event for the gridview. In the
event the grid is already fully built and you have access to all rows. Loop
through the rows, count your subtotals and enter them into the subtotal
rows.
 
S

Steven Cheng[MSFT]

Hi Mike,

It seems you're still struggling with this issue. I'm sure this could be
done through .net code. What's your current implementation of displaying
the top level data(BMW, Lexus.....) and the second level data(numbers of
each top level item)? Also, what's the datatable structure you retrieved
from database?

In your previous thread, I've mentioned the approach throug nested
databinding, do you think this is posible? Anyway, please feel free to let
me know your code logic and if necessary we can try working out a
simplified demo page on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hello Mike,

Thanks for your reply.

If so, would you give me the data's structure(maybe a datatable) you get
from the database layer? I think we still need to consider two approach:

1. do some customization on the returned data(datatable) and make the
databinding easier

2. use some databound control which is more flexible, such as the DataList
instead of Gridview.

If you feel convenient, you can send your current page stuff to me through
email(with test data schema) so that I can perform some test locally.

Please feel free to let me know if you have any other consideration.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hello Mike,

If you still have any questions or need any help on this issue, please
don¡¯t hesitate to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top