Foxtable(狐表)用户栏目专家坐堂 → [求助]如何在筛选树中实现多种条件筛选


  共有4237人关注过本帖树形打印复制链接

主题:[求助]如何在筛选树中实现多种条件筛选

帅哥哟,离线,有人找我吗?
utcxray
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:668 积分:5053 威望:0 精华:0 注册:2011/10/22 13:37:00
  发帖心情 Post By:2014/7/28 12:38:00 [显示全部帖子]

Dim mls As String() = {"分类","分类1","种类"}  '指定生成目录树的各列

Dim kh As String() = {"'","'","'"}  '指定将各列的值括起来的符号,这里都是字符型,所以都是单引号

Dim cs As WinForm.TreeView = e.Sender

Dim sx As String

Dim jd As WinForm.TreeNode

For Each jd In e.node.allNodes '清除子节点的选中标记

    jd.Checked = False

Next

jd = e.Node.ParentNode

Do While jd IsNot Nothing '清除父节点的选中标记

    jd.Checked = False

    jd = jd.ParentNode

Loop

For Each jd In cs.AllNodes

    If jd.Checked  Then

        Dim xjd() As String = jd.FullPath.Split("\")

        Dim val As String = ""

        For i As Integer = 0 To xjd.length - 1

            If val > "" Then

                val = val & " And "

            End If

            val = val & mls(i) & " = " & kh(i) & xjd(i) & kh(i)

        Next

        If sx > "" Then

            sx = sx & " Or (" & val & ")"

        Else

            sx = val

        End If

    End If

Next

Tables("供应商").Filter  = sx


e.Form.Controls("TreeView1").BuildTree("供应商", "分类|分类1|种类")





 回到顶部