'1、多值列,生成目录树,要增加实现统计数量,代码怎么修改呢?
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each dr As DataRow In DataTables("物料汇总").DataRows
For Each s As String In dr("项目空间类型").split(",")
If trv.Nodes.Contains(s) = False Then
trv.nodes.Add(s)
End If
Next
Next
'2、要实现单选,下面代码怎么修改,放在哪个属性事件里面呢?
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes '清除子节点选中状态
nd.Checked = False
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked Then
If flt > "" Then
flt = flt & " Or " '注意用or而不是And
End If
flt = flt & "( 项目空间类型 like '%" & nd.Text & "%')"
End If
Next
Tables("物料汇总").Filter = flt