Foxtable(狐表)用户栏目专家坐堂 → 节点对应列的赋值


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

主题:节点对应列的赋值

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


加好友 发短信
等级:九尾狐 帖子:2927 积分:20161 威望:0 精华:0 注册:2012/2/3 17:45:00
  发帖心情 Post By:2015/4/28 13:06:00 [只看该作者]

老师,
我改成下面的代码,选定的节点没有赋值“角色”,应该怎么改呢。

Dim tr1 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd3 As WinForm.TreeNode = tr1.SelectedNode


Dim nd,nd1 As  WinForm.TreeNode
nd = e.node
If nd.Nodes.Count > 0
    For Each nd1 In nd.AllNodes
        nd1.Checked = nd.Checked
        e.node.DataRow("角色") = nd3.Name
    Next
End If
If e.node.Checked = False
    Do While  nd.parentnode IsNot Nothing
        nd = nd.parentnode
        e.node.DataRow("角色") = nd3.Name
        If nd.Nodes.Count > 0
            For i As Integer = 0 To nd.Nodes.Count -1
                If nd.Nodes(i).Checked = True
                    e.node.DataRow("角色") = nd3.Name
                    Exit Do
                End If
                If i = nd.Nodes.Count -1
                    nd.Checked = False
                    e.node.DataRow("角色") =nd3.Name
                End If
            Next
        End If
    Loop
Else
    Do While  nd.parentnode IsNot Nothing
        nd = nd.parentnode
        nd.Checked = True
        e.node.DataRow("角色") =nd3.Name
    Loop
End If
[此贴子已经被作者于2015/4/28 13:58:32编辑过]

 回到顶部
总数 11 上一页 1 2