首先看看帮助是怎么做的:
http://www.foxtable.com/help/topics/0917.htm
既然可以人工插入一个“显示所有行”,同样可以人工插入一个"显示空值"
....
trv.Nodes.Insert("显示所有行",0)
trv.Nodes.Insert("显示空值",1)
....
原来筛选的代码改一下:
Dim Filter As String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.Text = "显示所有行" Then
Filter = ""
ElseIf e.Node.Text = "显示空值" Then
Filter = “mu is null and lei is null”
Else
Select Case e.Node.Level
Case 0
Filter = "[mu] = '" & dr("mu") & "'"
Case 1
Filter = "[mu] = '" & dr("mu") & "' And [lei] = '" & dr("lei") & "'"
End Select
End If
Tables("商品").Filter = Filter
学编程,不需要记忆什么,重在理解,理解了,才能随意变换。