老师,帮忙看看,问题出到哪里?
此主题相关图片如下:目录树运行出错.jpg

下面是目录树的代码:
Dim Filter As String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.Text <> "显示所有行" Then
Select Case e.Node.Level
Case 0
Filter = "[服务_区域] = '" & dr("服务_区域") & "'"
Case 1
Filter = "[服务_区域] = '" & dr("服务_区域") & "'" And "[服务_栋号] = '" & dr("服务_栋号") & "'"
Case 2
Filter = "[服务_区域] = '" & dr("服务_区域") & "'" And "[服务_栋号] = '" & dr("服务_栋号") & "'" And "[服务_层数] = '" & dr("服务_层数") & "'"
Case 3
Filter = "[服务_区域] = '" & dr("服务_区域") & "'" And "[服务_栋号] = '" & dr("服务_栋号") & "'" And "[服务_层数] = '" & dr("服务_层数") & "'" And "[服务_分区] = " & dr("服务_分区") & "'"
Case 4
Filter = "[服务_区域] = '" & dr("服务_区域") & "'" And "[服务_栋号] = '" & dr("服务_栋号") & "'" And " [服务_层数] = '" & dr("服务_层数") & "'" And "[服务_分区] = " & dr("服务_分区") & "'" And "[设备类型] = '" & dr("设备类型") & "'"
End Select
End If
Tables("设备联动服务").Filter = Filter
下面是窗口的AfterLoad:
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("设备联动服务","服务_区域|服务_栋号|服务_层数|服务_分区|设备类型")
trv.Nodes.Insert("显示所有行",0)