Hi all,
i have a datagridview with two columns (Group& Qty).
int _total = 0;
for (int c = 0; c < GridView1.Columns.Count; ++c)
{
for (int i = 0; i < GridView1.Rows.Count; ++i)
{
_total += Convert.ToInt32(GridView1.Rows[i].Cells["QTY"].Value);
}
}
//I don't know how to combine both Column and Row loops :SI would like to have the sum of each group.
GroupQty
A12
B14
C22
A9
C17
B1
A3
I have to get a return (MessageBox for example):
A= 24
B=15
C =39
Thank you,
Please do not forget to click “Vote as Helpful” if the reply helps/directs you toward your solution and or "Mark as Answer" if it solves your question. This will help to contribute to the forum.