Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") For Each dr1 As DataRow In DataTables("员工表").DataRows Dim nd1 As WinForm.TreeNode = trv.nodes.Add(dr1("员工姓名")) For Each dr2 As DataRow In dr1.GetChildRows("客户信息") Dim nd2 As WinForm.TreeNode = nd1.nodes.add(dr2("施工单位")) For Each dr3 As DataRow In dr2.GetChildRows("工程信息") nd2.nodes.add(dr3("工程名称")) Next Next Next
此主题相关图片如下:未命名.jpg 我想让出现在树里的员工只有销售员,其他的不想要,怎么办
-- 作者:czy
-- 发布时间:2012/3/8 19:21:00
--
For Each dr1 As DataRow In DataTables("员工表").DataRows If dr1("职位") = "销售员" Then Dim nd1 As WinForm.TreeNode = trv.nodes.Add(dr1("员工姓名")) End If
……
-- 作者:wlhjia
-- 发布时间:2012/3/8 20:07:00
--
For Each dr1 As DataRow In DataTables("员工表").DataRows Dim nd1 As WinForm.TreeNode
If dr1("职位") = "销售员" Then nd1 = trv.nodes.Add(dr1("员工姓名")) End If