老师我用这段代码在DataColChanged里面,有时汇总过去了,有时只汇总其中几行的列数据,还有就是如果某行的列内容发生变化,汇总过去的数据怎样及时变化。
汇总过去的数据最后多个 ,号 AAAA,BBBB,CCC,,
If e.DataCol.Name = "专业部室" OrElse e.DataCol.Name = "任务策划" Then
Dim pdr As DataRow = DataTables("项目策划书").find("信息编号 = '" & e.DataRow("信息编号") & "'")
If pdr IsNot Nothing Then
Dim str As String = ""
For Each dr As DataRow In DataTables("工作策划主表").Select("信息编号 = '" & e.DataRow("信息编号") & "'And 任务策划 = 任务策划")
str & = dr("专业部室") & ","
Next
pdr("专业部室") = str.trim(",")
End If
End If
[此贴子已经被作者于2016/4/26 17:33:16编辑过]