AfterCheckNode
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 = _dt事务经办人员指派.Find("分组 = \'" & nd1.Name & "\' And 事务 Is Null")
Else
dr = _dt事务经办人员指派.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
在后台中有一表,结构如下:
此主题相关图片如下:qq截图20150805142530.jpg
我现在求助的是,假定我在“冷轧作业区”上打个勾,下面的子节点不打勾,在后台的结果如下图:
此主题相关图片如下:qq截图20150805142755.jpg
而我现在希望的是在父结点上打了勾后,下面的子结点全部也勾上,这样后台的表上就会有这些员工的名字,方便我在其他表上引用,
但同时,“冷轧作业区”不能出现在后台表上,这个根本不是员工的名字。
谢谢!