Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
前天你说: 奇怪了,为什么刷新列没有用?一列一列刷新可以的. 下面就可以整列刷新啦:
你也是老狐先生了,应该看得出为什么刷新列没有用的原因了
If e.DataCol.Name = "产品" Then
If e.DataRow.IsNull("产品") Then
e.DataRow("出货明细") = Nothing
Else
Dim mx As String
Dim drs As List(Of DataRow)
drs = DataTables("出货明细").Select("[公司] = '" & e.DataRow("公司") & "'")
For Each dr As DataRow In drs
mx = mx & dr("出货时间") & " " & dr("出货数量") & vbCrLf
Next
e.DataRow("出货明细") = ""
e.DataRow("出货明细") = mx
End If
End If
如果你想在产品列发生变化后,时时刷新整列可以这样(也就是说不需要重置列了):
If e.DataCol.Name = "产品" Then
If e.DataRow.IsNull("产品") Then
e.DataRow("出货明细") = Nothing
Else
Dim mx As String
Dim drs As List(Of DataRow)
For Each dr0 As DataRow In DataTables("表A").datarows
drs = DataTables("出货明细").Select("[公司] = '" & dr0("公司") & "'")
For Each dr As DataRow In drs
mx = mx & dr("出货时间") & " " & dr("出货数量") & vbCrLf
Next
dr0("出货明细") = ""
dr0("出货明细") = mx
mx = ""
Next
End If
End If
呵呵,向Mr725兄的热心、认真、负责学习。