Foxtable(狐表)用户栏目专家坐堂 → 请教:树和表的筛选问题


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

主题:请教:树和表的筛选问题

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/6/8 11:33:00 [只看该作者]

 看不懂你想表达什么意思。参考代码,全局的click事件

 

If e.Sender.Name.StartsWith("rbtn") Then
    Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
    Dim nd As WinForm.TreeNode
    Dim tb As DataTable = DataTables("用户")
    Dim dt As DataTable = DataTables("部门")
    tr.StopRedraw()
    tr.Nodes.Clear
    Dim dr As DataRow
    Select Case e.Sender.Name
        Case "rbtn全部"
            tr.Nodes.Add("全部")
            For Each dr In dt.Select("部门id in (" & tb.GetComboListString("部门ID", "范围 = '全部'").Replace("|", ",") & ")")
                nd = tr.Nodes.Add(dr("部门ID"),dr("部门"))
                nd.Tag = dr("部门ID")
                Functions.Execute("递归",nd,dt)
            Next
        Case "rbtn本部门"
            For Each dr In dt.Select("部门id in (" & tb.GetComboListString("部门ID", "范围 = '本部门'").Replace("|", ",") & ")")
                nd = tr.Nodes.Add(dr("部门ID"),dr("部门"))
                nd.Tag = dr("部门ID")
                Functions.Execute("递归",nd,dt)
            Next
        Case "rbtn本部门及子部门"
        Case "rbtn上级部门"
        Case "rbtn上级及本部门和子部门"
        Case "rbtn子部门"
    End Select
    tr.ResumeRedraw
End If


 回到顶部
总数 12 1 2 下一页