I use this code to sum value from childrows to fill their parent rows :
Private Sub RadGridView1_CellValueChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles RadGridView1.CellValueChanged
If e.ColumnIndex = 13 AndAlso e.Column.OwnerTemplate IsNot Me.template.Templates Then
Me.EvaluateSumH2(CType(e.Row.Parent, GridViewRowInfo))
End If
If e.ColumnIndex = 7 AndAlso e.Column.OwnerTemplate IsNot Me.RadGridView1.MasterTemplate Then
Me.EvaluateSumH1(CType(e.Row.Parent, GridViewRowInfo))
End If
End Sub
Private Sub EvaluateSumH2(ByVal parent As GridViewRowInfo)
parent.Cells(7).Value = Me.RadGridView1.Evaluate("Sum(Total)", parent.ChildRows)
End Sub
Private Sub EvaluateSumH1(ByVal parent As GridViewRowInfo)
parent.Cells(4).Value = Me.RadGridView1.Evaluate("Sum(Total)", parent.ChildRows)
End Sub
But when I changed column to sum is an expression column, the sum function does not work.
Dim Total As New GridViewDecimalColumn("Total")
Total.Name = "Total"
Total.HeaderText = "Total"
template1.Columns.Add(Total)
template1.Columns("Total").Expression = "a * b* c* d* e"
Please help, thanks before.
Regards