Question adding numbers from a datagridviw based on a combo box selection

abdiabolo

New member
Joined
Feb 22, 2012
Messages
3
Programming Experience
1-3
In my below forms, the user select a name from the combo box list and enters an amount for the name selected. The user can enter as many entries. Every time the total button is clicked, I would like the total for each person to be display on the labels. Can I please get some help.
total.JPGdata.JPG
 
The simplest way would be to use LINQ but I'm guessing that that is probably a bit beyond you at present. Think about how you would do it if this wasn't a computer program. How would you do it if you had to use a pen and paper? You would simply start at zero for each person and look down the list and and add each value to the appropriate person's total as you went, right? Well, that's exactly how you do it in a computer program. Do you know how to write a For Each loop? That's what you need, because you have to perform an action for each row in the grid.
 
Back
Top