title: devexpress grid control custom sum on specified columns
body: <p>I'm trying to sum some column values via cell selection (3 columns are affected). It works, but the tree sum values are always the same for all the 3 columns.</p>
  
  <p>I'm trying this:</p>
  
  <pre><code>Private Sub gvIktato_CustomSummaryCalculate(ByVal sender As Object, ByVal e As DevExpress.Data.CustomSummaryEventArgs) Handles gvIktato.CustomSummaryCalculate
          Dim View As GridView = CType(sender, GridView)
          If e.SummaryProcess = CustomSummaryProcess.Calculate Then
              If View.IsCellSelected(e.RowHandle, gvIktato.Columns("NETTO")) Then e.TotalValue = Convert.ToDecimal(e.TotalValue) + Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, "NETTO"))
              If View.IsCellSelected(e.RowHandle, gvIktato.Columns("BRUTTO")) Then e.TotalValue = Convert.ToDecimal(e.TotalValue) + Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, "BRUTTO"))
              If View.IsCellSelected(e.RowHandle, gvIktato.Columns("SKONTO_OSSZEG")) Then e.TotalValue = Convert.ToDecimal(e.TotalValue) + Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, "SKONTO_OSSZEG"))
          End If
      End Sub
  </code></pre>
  
  <p>How should I rewrite the code, that I get the correct sum values for each column?</p>
  
  <p>I know, I should distinguish somehow between the columns, but how?</p>
  
  <p>Thanks.</p>