Dim i As Integer = 0
Dim total As Double = 0.0
Dim avg As Double = 0.0
Dim i2 As Integer = 0
Dim total2 As Double = 0.0
Dim avg2 As Double = 0.0
Dim persenC As Double
If e.Row.RowType = DataControlRowType.DataRow Then
i += 1
total += CDbl(DataBinder.Eval(e.Row.DataItem, "expect"))
i2 += 1
total2 += CDbl(DataBinder.Eval(e.Row.DataItem, "Expr1"))
ElseIf e.Row.RowType = DataControlRowType.Footer Then
avg = total / i '= 1.28571428571 จะให้ = 1.28
avg2 = total2 / i2 '= 2.99571428571 จะให้ = 2.99
persenC = (avg2 / avg) * 100 'เพื่อเอามาคำนวณค่านี้