如图所示:当我点击第二列的时候希望能弹出下拉窗口,当我在下拉窗口中选择数据时,比如第一层节点是2-相机,第二层节点是21-DV,22-DC,当我选择21-DV和22-DC的时候,希望能在第一列中填入2(注意是只填入2,而不填入2-相机),在第二列中填入21,22.目前下拉窗口已经完成,就是选择数据的时候希望能在第一列填入第一层节点的数字(比如2),在第二列中只填入21,22,这个该怎么实现?
窗口的DropDownOpened事件设置为:
Dim
s
As
String = e.Form.DropDownBox.Value
Dim
nms
As
new
List(of
String)
Dim
trv
As
WinForm.TreeView = e.Form.Controls("TreeView1")
If
s > ""
Then
nms.AddRange(s.Split(","))
End
If
For
Each
nd
As
WinForm.TreeNode
In
trv.AllNodes
nd.Checked = nms.Contains(nd.text)
Next
确定按钮的代码设置为:
Dim
s
As
String
Dim
trv
As
WinForm.TreeView = e.Form.Controls("TreeView1")
For
Each
nd
As
WinForm.TreeNode
In
trv.AllNodes
If
nd.Checked
Then
s = s
&
","
&
nd.Text
End
If
Next
e.Form.DropDownBox.Value = s.trim(",")
e.Form.DropDownBox.CloseDropdown
此主题相关图片如下:ff.png