DatacolChanged事件
Select Case e.DataCol.name Case "物品号", "入库数量" Dim filter As String = "物品号 = '" & e.DataRow("物品号") & "'" Dim sum1 As Double = e.DataTable.Compute("sum(入库数量)", filter) e.DataTable.ReplaceFor("累计数量", sum1, filter)End Select