Looping through all rows and columns (to get sub-totals for each column and row)

R

Ralph Hartman

Is there a way to loop through all rows and columns in order to fill a
sub-totaled columns and a sub-totaled row (footer). I thought about
doing this through SQL transact but I will be using the rowfilter to
filter out certain rows and the total number of rows or columns will
never be constant.

My datagrid is made up of a district column and a matrix of numbers
like this.
[RAW Data Grid]
District1 1 2 2 3 0
District2 2 2 1 0 3
..
..
..
District(N) 4 0 1 0 0
-----------------------------------------------------

I would like it to look like this
[Ending Grid with sub totals for each row and column]
District1 1 2 2 3 0 8
District2 2 2 1 0 3 8
..
..
..
District(N) 4 0 1 0 0 5
Totals 7 4 4 3 3 21

Thank you so much in advance for the help.
 
R

Raghavendra T V

Hi,

You can use the Datagrid 's Event OnDataItemBound.

This event is fired for each and every Row of the Datagrid.

Thanks
Raghavendra
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top