Dim Filter As String = ""
If e.node.Name <> "所有行" Then '要用Name属性,不能用Text属性
Dim Product1 As String = e.Node.DataRow("状态")
Dim Product2 As String = e.Node.DataRow("类别")
Select Case e.Node.Level
Case 0
Filter = "[类别] = '" & e.Node.DataRow("类别") & "'"
Case 1
Filter = "[类别] = '" & e.Node.DataRow("类别") & "'And 状态 = '" & Product1 & "'"
End Select
End If
DataTables("生产计划表").LoadFilter = Filter
DataTables("生产计划表").Load()
如果上面的代码不能正常运行,则运行下面的代码。下面是按日期选择的代码(不全,代表实际的代码):
''------------------------------------筛选树(按日期)-------------------------------------------------------------------------------
'Dim Filter As String = ""
'If e.node.Name <> "显示所有行" Then '要用Name属性,不能用Text属性
'Dim d1 As Date
'Dim d2 As Date
'Dim Year As Integer = e.Node.DataRow("年")
'Dim Month As Integer = e.Node.DataRow("月")
'Dim day As Integer = e.Node.DataRow("日")
'Dim Product As String = e.Node.DataRow("购买单位")