--
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
If trv.Nodes(0).Name = e.Node.Name
If e.Node.Checked
For Each nd As WinForm.TreeNode In trv.AllNodes
nd.Checked = False
Next
e.Node.Checked = True
Else
flt = "1=2"
End If
Else
trv.Nodes(0).Checked = False
Dim nms As String() = {"团体赛或个人赛","棋赛名称","所属团体或个人分组","姓名"} \'指定生成目录树的各列
Dim qts As String() = {"\'","\'","\'","\'"} \'指定将各列的值括起来的符号,这里都是字符型,所以都是单引号
Dim n As WinForm.TreeNode = e.Node.ParentNode
For Each nd As WinForm.TreeNode In e.Node.AllNodes
nd.Checked = e.Node.Checked
Next
Do While n IsNot Nothing
Dim chhh As Boolean = True
For Each nd As WinForm.TreeNode In n.AllNodes
If nd.Checked = False Then
chhh = False
Exit For
End If
Next
n.Checked = chhh
n = n.ParentNode
Loop
If e.node.Checked = False Then \'去除当前字节选勾
Do While n IsNot Nothing
n.Checked = False \'去掉父节点选中状态
n = n.ParentNode
Loop
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked Then
Dim rts() As String = nd.FullPath.Split("\\")
Dim val As String = ""
For i As Integer = 0 To rts.length - 1
If val > "" Then
val = val & " And "
End If
val = val & nms(i) & " = " & qts(i) & rts(i) & qts(i)
Next
If flt > "" Then
flt = flt & " Or (" & val & ")"
Else
flt = val
End If
End If
Next
End If
With DataTables("基本信息")
.LoadFilter = flt \'设置加载条件
.LoadPage = 0 \'加载第一页
.LoadTop = 20 \'每页5行
.LoadOrder = "团体赛或个人赛,棋赛名称 desc,所属团体或个人分组,姓名"
.LoadReverse = True
.Load()
e.Form.Controls("TextBox3").Value = 1 & "/" & .TotalPages
End With