title: Sum values in column that match selected value in other column
body: <p>How can I get the sum of values from the column "Quantity" that match a selected value in the column "Le Nom". For example :</p>
  
  <pre><code>Le Nom      Quantity
  HEA200      200
  HEB300      150
  IPE450      700
  HEA200      300
  </code></pre>
  
  <p>Let's say that the first row is selected, I want to sum the first one (200) and the fourth one (300) since they share the same value (HEA200).</p>
  
  <p>Here is my code to get the sum of all values, but I can't achieve my goal.</p>
  
  <pre><code>int sum = 0;
  
  string NameProfil = 
      gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "Le Nom").ToString();
  
  for (int i = 0; i &lt; gridView2.RowCount; i++) 
  {
      sum += int.Parse(Convert.ToString(gridView2.GetRowCellValue(i, "Quantité")));
  }
  
  MessageBox.Show(sum.ToString() + " "+ NameProfil);
  </code></pre>