以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  目录树排序  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=115294)

--  作者:aizaishuzui
--  发布时间:2018/3/4 16:39:00
--  目录树排序
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:测试用.foxdb

已经多次排查代码出现的问题,但还是找不到根源,求助老师

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("类别","一级类别|二级类别|三级类别","","类别编号,类别编号,类别编号")
trv.StopRedraw


图片点击可在新窗口打开查看此主题相关图片如下:666.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间: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


--  作者:aizaishuzui
--  发布时间:2018/3/4 17:43:00
--  回复:(有点甜)bug,暂时变通处理一下 Dim...
好的    谢谢哈