Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
在查询参考表DataColChanged事件添加如下代码:
If e.DataCol.Name = "物料名称" Then
DataTables("配方汇总表").StopRedraw '停止绘制
DataTables("配方汇总表").ReplaceFor("查询筛选辅助列", Nothing)
Dim Filter As String = "[物料名称] = '" & e.DataRow("物料名称") & "'"
Dim dr As DataRow = e.DataRow
dr("查询筛选辅助列") = "ok"
Dim drs As List(Of DataRow)
Dim pr As DataRow
drs = DataTables("配方明细表").Select(Filter)
For Each dr1 As DataRow In drs
pr = dr1.GetParentrow("配方汇总表")
pr("查询筛选辅助列") = "ok"
Next
DataTables("配方汇总表").ResumeRedraw '恢复绘制
End If
目前可以实现功能,但是执行效率比较低,用模拟关联会效率高一些吗?
If e.DataCol.Name = "物料名称" Then
DataTables("配方汇总表").StopRedraw '停止绘制
DataTables("配方汇总表").ReplaceFor("查询筛选辅助列", Nothing)
Dim Filter As String = "[物料名称] = '" & e.DataRow("物料名称") & "'"
Dim dr As DataRow = e.DataRow
dr("查询筛选辅助列") = "ok"
DataTables("配方汇总表").ReplaceFor("查询筛选辅助列", "ok","关联列 in ('" & DataTables("配方明细表").GetComboListString("关联列",Filter).replace("|","','") & "')")
DataTables("配方汇总表").ResumeRedraw '恢复绘制
End If