我在窗口事件里设置这个代码,自动生成目录树:
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
tr.BuildTree("管理表", "管理项目|客户编号|合同编号")
在目录树的单击按钮中放入此代码:
'Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
'Dim s As String = e.Sender.SelectedNode.Text
For Each t As Table In Tables
If s= t.name Then
e.Form.StopRedraw
Dim sp As WinForm.SplitContainer
sp = e.Form.CreateControl("SplitContainer3", ControlTypeEnum.SplitContainer)
e.Form.Controls("SplitContainer2").Panel2.AddControl(sp)
sp.Dock = Windows.Forms.DockStyle.Fill
sp.BorderStyle=Windows.Forms.BorderStyle.Fixed3D
sp.Orientation = System.Windows.Forms.Orientation.Horizontal
e.Form.Controls("SplitContainer3").Panel2.Collapsed = True
Dim tbl1 As WinForm.Table
tbl1 = e.Form.CreateTable("Table1", s,False)
e.Form.Controls("SplitContainer3").Panel1.AddControl(tbl1)
tbl1.Dock = Windows.Forms.DockStyle.Fill
Tables(s).Focus
e.form.ResumeRedraw
End If
Next
我在双击的节点:
Dim s As String = e.Sender.SelectedNode.Text
For Each t As Table In Tables
If s= t.name Then
Dim Value()As String
Value = e.Node.FullPath.Split("\")
Select Case e.Node.Level
Case 0
Tables(s).Filter ="[客户编号] = '" & Value(0) & "'"
Case 1
Tables(s).Filter ="[客户编号] = '" & Value(0) & "' And [合同编号] = '" & Value(1) & "'"
End Select
End If
Next
这个筛选不起作用.我要跟着第一个节点筛选客户编号,根据第二个节点筛选合同编号,我把e.Node.FullPath.Split("\")改成 s.Split("\")也没有用.
应该怎么修改这个筛选代码?