Loop through a DataGridView and add values where rows are checked
<p>I have a C# application and I have DataGridView which I can either bind to a datasource or dynamically load data but is irrelevant to what I need to do.</p>

<p>To Illustarte - I have three columns. The first column is a checkbox followed by an ID column which is not unique and can contain duplciates and then an Amount column.</p>

<p>I need to load the data into seperate rows so I do not want to accumulate the dataset before populating the DataGridView as the user will select the values to mark off so - I want to loop through the the datagridview and for all checked rows, accumulate or sum up the amount column where the ID's are the same.</p>

<p>As an example, below is a sample of the data.
ID    Amount<br>
1     50.25<br>
2     15.20<br>
3     66.95<br>
1     12.01<br>
3     15.15<br>
1     85.27</p>

<p>If we assume that the first two records for ID 1 are checked, I want to loop through the DataGridView and add the amounts together and have one amount for all checked rows<br>
but in this case for ID 1 (50.25 + 12.01 = 62.26)</p>

<p>Any Suggestions?</p>

<p>Thanking you in advance.</p>
