datacolchanged事件,本来的事件代码删掉。
If e.DataCol.Name = "页码" Then
Dim cnt As Integer = e.DataTable.Compute("sum(页码)","_sortkey <= " & e.DataRow("_sortkey") & " and _Identify <> " & e.DataRow("_Identify"))
e.DataRow("页码范围") = (cnt +1) & "-" & (cnt + e.DataRow("页码"))
Dim drs = e.DataTable.Select("_sortkey >= " & e.DataRow("_sortkey"))
For i As Integer = 0 To drs.Count - 1
Dim r As DataRow = drs(i)
If r.IsNull("页码") = False Then
r("页码范围") = (cnt +1) & "-" & (cnt + r("页码"))
cnt = cnt + r("页码")
End If
Next
End If