Foxtable(狐表)用户栏目专家坐堂 → 目录树排序


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

主题:目录树排序

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/4 17:33:00 [显示全部帖子]

bug,暂时变通处理一下

 

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")

Dim cs As String() = "一级类别|二级类别|三级类别".split("|")
Dim os As String () = "类别编号,类别编号,类别编号".split(",")
Dim dt As DataTable = DataTables("类别")
Dim filter As String = "1=1"

For Each lvl1 As String In dt.GetValues(cs(0), filter & " and " & cs(0) & " Is not null", os(0))
    Dim nd1 = trv.nodes.add(lvl1)
    For Each lvl2 As String In dt.GetValues(cs(1), filter & " and " & cs(1) & " Is not null" & " And " & cs(0) & " = '" & lvl1 & "'", os(1))
        Dim nd2 = nd1.nodes.add(lvl2)
        For Each lvl3 As String In dt.GetValues(cs(2), filter & " and " & cs(2) & " Is not null" & " and " & cs(0) & " = '" & lvl1 & "' and " & cs(1) & " = '" & lvl2 & "'", os(2))
            Dim nd3 = nd2.nodes.add(lvl3)
        Next
    Next
Next


 回到顶部