以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 目录树勾选, (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=150189)
|
-- 作者:yifan3429
-- 发布时间:2020/5/23 9:16:00
-- 目录树勾选,
Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim nd1 As WinForm.TreeNode = trv1.SelectedNode Dim dr As DataRow If e.Node.ParentNode IsNot Nothing Then \'取消父节点的选中标记,因为选中子节点,就不要选中父节点了 e.Node.ParentNode.Checked = False End If For Each cnd As WinForm.TreeNode In e.Node.Nodes \'取消子节点的选中标记,因为选中父节点,就不要选中子节点了 cnd.Checked = False Next If nd1.Level = 0 Then dr = DataTables("授权").Find("分组 = \'" & nd1.Name & "\' And 权限 Is Null") Else dr = DataTables("授权").Find("分组 = \'" & nd1.ParentNode.Name & "\' And 权限 = \'" & nd1.Name & "\'") End If If dr IsNot Nothing Then Dim nms As String For Each nd2 As WinForm.TreeNode In trv2.AllNodes If nd2.Checked Then nms = nms & "," & nd2.Name End If Next If nms > "" Then dr("用户") = nms.Trim(",") Else dr("用户") = Nothing End If
End If
现在用户的目录树勾选是部门和职员是相互排斥的,我想勾选或是取消时部门的时候,部门和和职员一起加入 例如 主管,张珊,单独勾选员工的时候,只有张珊,
|
-- 作者:有点蓝
-- 发布时间:2020/5/23 10:19:00
--
截图说明一下
|
-- 作者:yifan3429
-- 发布时间:2020/5/25 8:03:00
--
此主题相关图片如下:企业微信截图_20200525080103.png
|
-- 作者:有点蓝
-- 发布时间:2020/5/25 8:55:00
--
If e.Node.ParentNode IsNot Nothing Then \'取消父节点的选中标记,因为选中子节点,就不要选中父节点了 e.Node.ParentNode.Checked = e.Node.Checked End If For Each cnd As WinForm.TreeNode In e.Node.Nodes \'取消子节点的选中标记,因为选中父节点,就不要选中子节点了 cnd.Checked = e.Node.Checked Next
|