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.
I'm trying this:
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
How should I rewrite the code, that I get the correct sum values for each column?
I know, I should distinguish somehow between the columns, but how?
Thanks.