请教老师,下面代码能实现选择1个或多个复选框后,节点的String会填入到表A的列“范围”中,取消勾选,清除String
问题:现在想实现,勾选复选框后,把节点Level0 和Level1的字符填入到指定列中,应该怎样调整代码
例如:
目录树由表B的一级分类和二级分类生成目录树
目录树 表A
+ A类 范围
√A1 A类:A1
√A2 A类:A2
+ B类 B类:B2
B1
√B2
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
Dim r As Row = Tables("表A").Current
For Each nd As WinForm.TreeNode In e.node.Nodes
nd.Checked = False
Next
If e.node.ParentNode IsNot Nothing Then
e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked Then
If flt > "" Then
flt = flt & vbcrlf & vbcrlf
End If
'If nd.Level = 0 Then
flt = flt & nd.Text
'Else
'flt = flt & "( 一级分类 = '" & nd.ParentNode.Text & "' And 二级分类 = '" & nd.Text & "')"
'End If
End If
Next
r("范围") = flt