-- 作者:有点甜
-- 发布时间:2019/6/17 16:07:00
--
Select Case e.DataCol.Name Case "第五列" Dim dr As DataRow Dim drs As List(of DataRow) dr = e.DataTable.Find("[_SortKey] < " & e.DataRow("_SortKey"), "[_SortKey] Desc") \'找出上一行 If dr Is Nothing Then \'如果没有找到上一行,说明本行就是第一行 e.DataRow("第六列") = 0 dr = e.DataRow End If drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey"), "[_SortKey]") For i As Integer = 1 To drs.Count - 1 \'重算余下行的余额 drs(i)("第六列") = (drs(i)("第五列")- drs(i-1)("第五列")).totalseconds Next End Select
|