Foxtable(狐表)用户栏目专家坐堂 → [求助]如何按列内容生成目录树?


  共有18419人关注过本帖平板打印复制链接

主题:[求助]如何按列内容生成目录树?

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


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2010/3/24 0:22:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目102.rar



Dim nd As WinForm.TreeNode
For Each dr As DataRow In DataTables("表A").Select("","类别")
    Dim Path As String = dr("类别")
    Dim Parts() As String = Path.Split("\")
    Dim Start As Integer
    If nd IsNot Nothing Then
        Do
            If Path.StartsWith(nd.FullPath) Then
                Start = nd.Level + 1
                nd = nd.Nodes.Add(Parts(Start),Parts(start))
                Start = nd.Level + 1
                Exit do
            Else
                nd = nd.ParentNode
                If nd Is Nothing Then
                    Exit do
                End If
            End If
        Loop
    End If
    If nd Is Nothing Then
        nd = e.Form.Controls("TreeView1").Nodes.Add(Parts(0),Parts(0))
        start = 1
    End If
    For i As Integer = Start To Parts.Length - 1
        nd = nd.Nodes.Add(Parts(i),Parts(i))
    Next
Next
[此贴子已经被作者于2010-3-24 1:00:34编辑过]

[本帖被加为精华]
 回到顶部
总数 29 1 2 3 下一页