Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

can someone point the way on one this. I have a datagrid and am trying to sum up all the values in column3 together, some cells in that column have null values while others have integer values as you can see below. Like below the cell under column 3 under the value 400 and adjacent to colour blue and the material cotton are empty (null) values and this goes on down the row so how can i sum the entire cells in the column together.

Column1 Column2 Column3 Column4

- 1 blouse 400 0 ----------(node or parent node)
Blue 1 --------(Sub node or child row)
Cotton 1 --------(Sub node or child row)

- 3 Camisole 350 0 ----------(node or parent node)
White 2 --------(Sub node or child row)
Linen 2 --------(Sub node or child row)
Press Only 175 2 --------(Sub node or child row)

- 2 Dress 250 0 ----------(node or parent node)
Yellow 3 --------(Sub node or child row)
Wool 3 --------(Sub node or child row)
Press Only -125 3 --------(Sub node or child row)

- 2 Shorts 450 0 ----------(node or parent node)
Yellow 4 --------(Sub node or child row)
Wool 4 --------(Sub node or child row)
Press Only -225 4 --------(Sub node or child row)

regards

ade
Posted
Comments
Shraddha R Kad 16-Jul-13 7:55am    
can you show us the main code lines

1 solution

Are you using database? Then it will be better to add the data from the database. it will be more accurate and less coding.
 
Share this answer
 
Comments
mabadeje 16-Jul-13 12:27pm    
nope, just using a programmatically defined data table with defined columns and rows to load data onto the datagrid

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900