以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]目录树 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=193304) |
||||
-- 作者:江南小镇 -- 发布时间:2024/9/3 12:06:00 -- [求助]目录树 老师,目录树节点筛选没有作用。 Dim s As String = e.Form.Controls("复选框").Text Dim Colstr() As String Dim qts As String() = {"\'","#",""} Dim trv As WinForm.TreeView = e.Sender Dim flt As String = "" Dim nd As WinForm.TreeNode Dim pd As WinForm.TreeNode Dim notchecked As Integer = 0 Colstr = s.split(",") For i As Integer = 0 To Colstr.Length - 1 If Tables("水电气数据查询_Table1").Cols.Contains(Colstr(i)) = False Then If trv.Nodes.Count > 0 Then trv.Nodes.Clear() End If e.Form.Controls("复选框").Text = "选择筛选列(最好包括拼音)" Return End If Next If e.Node.Name = "显示所有行" Then If e.Node.Checked = True Then For Each nd In trv.AllNodes If nd.Name <> "显示所有行" Then nd.Checked = False End If Next Tables("水电气数据查询_Table1").Filter = "" Else For Each nd In trv.AllNodes nd.Checked = False Next Tables("水电气数据查询_Table1").Filter = (1 = 2) End If trv.CollapseAll Return Else trv.AllNodes(0).Checked = False End If For Each nd In e.node.allNodes nd.Checked = False Next pd = e.Node.ParentNode Do While pd IsNot Nothing pd.Checked = False pd = pd.ParentNode Loop For Each nd 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 Tables("水电气数据查询_Table1").DataTable.DataCols(Colstr(i)).IsString Then If rts(i) <> "空" Then If val > "" Then val = val & " And " val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0) Else val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0) End If ElseIf rts(i) = "空" Then If val > "" Then val = val & " And " val = val & Colstr(i) & " Is Null" Else val = val & Colstr(i) & " Is Null" End If End If ElseIf Tables("水电气数据查询_Table1").DataTable.DataCols(Colstr(i)).IsDate Then If rts(i) <> #0001-1-1 0:00:00# Then If val > "" Then val = val & " And " val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1) Else val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1) End If ElseIf rts(i) = #0001-1-1 0:00:00# Then If val > "" Then val = val & " And " val = val & Colstr(i) & " Is Null" Else val = val & Colstr(i) & " Is Null" End If End If ElseIf Tables("水电气数据查询_Table1").DataTable.DataCols(Colstr(i)).IsNumeric Then If rts(i) <> 0 Then If val > "" Then val = val & " And " val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2) Else val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2) End If ElseIf rts(i) = 0 Then If val > "" Then val = val & " And " val = val & Colstr(i) & " Is Null" Else val = val & Colstr(i) & " Is Null" End If End If ElseIf Tables("水电气数据查询_Table1").DataTable.DataCols(Colstr(i)).IsBoolean Then If rts(i) <> False Then If val > "" Then val = val & " And " val = val & Colstr(i) & " = " & qts(0) & True & qts(0) Else val = val & Colstr(i) & " = " & qts(0) & True & qts(0) End If ElseIf rts(i) = False Then If val > "" Then val = val & " And " val = val & Colstr(i) & " = " & qts(0) & False & qts(0) Else val = val & Colstr(i) & " = " & qts(0) & False & qts(0) End If End If End If Next If flt > "" Then flt = flt & " Or (" & val & ")" Else flt = val End If notchecked + = 1 End If Next MsgBox(flt) If flt > "" AndAlso notchecked > 0 Then Tables("水电气数据查询_Table1").Filter = flt Else Tables("水电气数据查询_Table1").Filter = (1 = 2) End If
|
||||
-- 作者:有点蓝 -- 发布时间:2024/9/3 13:36:00 -- 目录树没有开启复选框。参考这种用法:http://www.foxtable.com/webhelp/topics/0917.htm |
||||
-- 作者:江南小镇 -- 发布时间:2024/9/3 14:44:00 -- 老师好,目录树筛选开启修改。
|
||||
-- 作者:有点蓝 -- 发布时间:2024/9/3 15:37:00 --
|