请问在多选筛选树中,如何实现系统中的显行所有行功能,即清除所有节点的选中标记
此主题相关图片如下:3.png

窗口10_AfterLoad
Dim flt As
WinForm.TreeView = e.Form.Controls("TreeView1")
flt.BuildTree("出库",
"部门|类别|物料名称")
flt.Nodes.Insert("显示所有行",0)
窗口10_TreeView1_AfterCheckNode
Dim nms As
String() = {"部门","类别","物料名称"} '指定生成目录树的各列
Dim qts As
String() = {"'","'","'"} '指定将各列的值括起来的符号,这里都是字符型,所以都是单引号
Dim trv As
WinForm.TreeView = e.Sender
Dim Flt As String
= ""
Dim nd As
WinForm.TreeNode
For Each nd In
e.node.allNodes '清除子节点的选中标记
nd.Checked = False
Next
nd =
e.Node.ParentNode
Do While nd IsNot
Nothing '清除父节点的选中标记
nd.Checked = False
nd = nd.ParentNode
Loop
For Each nd In
trv.AllNodes
If nd.Checked Then
Dim rts() As String =
nd.FullPath.Split("\")
Dim val As String = ""
For i As Integer = 0 To rts.length - 1
If val > "" Then
val = val & " And
"
End If
val = val & nms(i) & "
= " & qts(i) & rts(i) & qts(i)
Next
If flt > "" Then
flt = flt & " Or ("
& val & ")"
Else
flt = val
End If
End If
Next
Tables("出库").Filter = flt