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


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

主题:递归函数目录树排序

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/8/6 17:12:00 [显示全部帖子]

原来是:

 

Dim nd As WinForm.TreeNode = args(0)
Dim dt As DataTable = args(1)
Dim drs As List(of DataRow)
drs = dt.Select("[父键] = '" & nd.name & "'")
For Each dr As DataRow In drs
    Dim cd As Winform.TreeNode = nd.Nodes.Add(dr("键"),dr("标题"))
    Functions.Execute("AddChildren",cd,dt)
Next

 

 

你改为:

 

Dim nd As WinForm.TreeNode = args(0)
Dim dt As DataTable = args(1)
Dim drs As List(of DataRow)
drs = dt.Select("[父键] = '" & nd.name & "'", "排序列")
For Each dr As DataRow In drs
    Dim cd As Winform.TreeNode = nd.Nodes.Add(dr("键"),dr("标题"))
    Functions.Execute("AddChildren",cd,dt)
Next

 


 回到顶部