473,320 Members | 2,104 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,320 software developers and data experts.

need to count rows for particular columns if no data then ignore and count

I have the following table:

Expand|Select|Wrap|Line Numbers
  1. A          B            C
  2.  
  3. 1          0            0
  4. 0          1            1
  5. 0          0            0
  6. 1          1            0
  7.  
I would like to calculate the sum of each columns and display the results in the footer.

So the count displayed in the the footer that I would like to show would look like this for my table
Expand|Select|Wrap|Line Numbers
  1. A          B            C
  2.  
  3. 1          0            0
  4. 0          1            1
  5. 0          0            0
  6. 1          1            0
  7. ===========================
  8. 2           2           1
  9.  


The data already bound to the grid.

Now, how do I use the RowDataBound event to accomplish this using vb.net?
Oct 6 '10 #1
1 1201
Frinavale
9,735 Expert Mod 8TB
Declare some class level variables that will keep track of the sums for each column.

For example:
Expand|Select|Wrap|Line Numbers
  1. Dim columnASum As Integer
  2. Dim columnBSum As Integer
  3. Dim columnCSum As Integer
During the RowDataBound event, retrieve the data from each column and add it to the appropriate sum.

I'm not sure if you are developing an ASP.NET application or a Win-forms desktop application so I cannot help you any further at this point.

What have you tried so far to solve the problem?

-Frinny
Oct 6 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

68
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
1
by: praneethraj | last post by:
i have 2 rows with 3 columns each. ( each rows has a colun called ScoreType which contains different data like Performancelevel,scaledscore Subject Marks ScoreType A ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.