农行明细表_DataColChanged
Select Case e.DataCol.Name
Case "收入","支出"
For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
Dim Val1 As Double = e.DataTable.Compute("Sum(收入)","[_SortKey] <= " & dr("_SortKey"))
Dim Val2 As Double = e.DataTable.Compute("Sum(支出)","[_SortKey] <= " & dr("_SortKey"))
dr("余额") = Val1 - Val2
Next
End Select
农行明细表_DataRowDeleting
e.DataRow("收入") = 0
e.DataRow("支出") = 0
农行明细表_AfterMoveRow
Dim Key As Decimal
Dim Index As Integer
Dim dc As DataCol
Index = Math.Min(e.OldIndex, e.NewIndex)
Key = e.Table.Rows(Index)("_SortKey")
dc = e.Table.DataTable.DataCols("收入")
dc.RaiseDataColChanged("[_SortKey] >= " & Key)
农行明细表_DrawCell
If e.Col.name="收入" Then
e.Style="收入样式"
End If
另外一个表是一样的代码。