473,395 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

subheaders with totals

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

Nov 4 '06 #1
5 1339
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.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"igotyourdotnet" <ig************@nospam.nospamwrote in message
news:OM**************@TK2MSFTNGP04.phx.gbl...
>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

Nov 5 '06 #2
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Nov 6 '06 #3
The nested databinding didn't work.

"Steven Cheng[MSFT]" wrote:
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Nov 6 '06 #4
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.

Nov 7 '06 #5
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.

Nov 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: New Guy | last post by:
I'm trying to work with a system that somebody else built and I am confounded by the following problem: There is a table of payments and a table of charges. Each client has charges and payments...
6
by: KashMarsh | last post by:
Trying to show running totals on a report, except it needs to show one total amount and values being subtracted from it. For example, the report shows a Total Inventory amount (TotInvAmt). And...
4
by: spammy | last post by:
Hi all, Is it possible to create subheaders in datagrids? Or rather to add a parent header row to an existing datagrid? Currently my DG looks like this: NAME | A - PART1 | A - PART2 | A -...
2
by: BerkshireGuy | last post by:
I have the following code: Dim strSQL As String Dim DB As DAO.Database Dim RS As DAO.Recordset Dim intNumOfPaid, intNumOfHypoed, intNumOfNotTaken, intNumOfDeclined, intNumOfWasted,...
2
by: Greg | last post by:
I was wondering if there is a simple way to present a totals column in a bound datagrid where the totals aren't actually persisted (in my case to an xml file). Ideally, when I populate the datagrid...
3
by: brm6546545 | last post by:
I have a tblTax. It has fields InvoiceNum, TaxAuthority, TaxableTotal, NonTaxableTotal, TaxCollected. Sample data 1,county,10.00,0.00,0.40 1,city,10.00,0.00,0.10 2,state,0.00,15.00,0.15 ...
3
by: igotyourdotnet | last post by:
I'm using a gridview and I have it formatted using sub headings. now I need to get totals for each sub heading. Is this possible? example: BMW (sub heading) 25,000 14,252 25,000 total:...
4
by: Micheal | last post by:
Greetings Access Group, Being relatively new to Access, I try to work through problems on my own and have been very successful, although I have a conundrum that I have been working on for two days...
5
prn
by: prn | last post by:
Hi folks, I'm looking for a little advice here. I need to create a report that is totals only, with no detail records. I have a database with a lot of individuals (people) and the report has to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.