代码
Dim t As Table = Tables("表a")
Dim dt As DataTable = DataTables("分组")
If e.node.Level > 0 Then
If e.Node.FullPath.StartsWith("按分组") Then
Dim filter As String = ""
Dim dr As DataRow = e.Node.DataRow
If e.Node.Level = 1 Then
filter = "省 = '" & dr("省") & "'"
Else If e.Node.Level = 2 Then
filter = "省 = '" & dr("省") & "' and 市 = '" & dr("市") & "'"
Else If e.Node.Level = 3 Then
filter = "省 = '" & dr("省") & "' and 市 = '" & dr("市") & "' and 区县 = '" & dr("区县") & "'"
Else If e.Node.Level = 4 Then
filter = "省 = '" & dr("省") & "' and 市 = '" & dr("市") & "' and 区县 = '" & dr("区县") & "' and 乡镇 = '" & dr("乡镇") & "'"
Else If e.Node.Level = 5 Then
filter = "省 = '" & dr("省") & "' and 市 = '" & dr("市") & "' and 区县 = '" & dr("区县") & "' and 乡镇 = '" & dr("乡镇") & "' and 街道居委 = '" & dr("街道居委") & "'"
End If
Dim idxs As String = "'" & dt.GetComboListString("街道居委", filter).Replace("|", "','") & "'"
t.Filter = "分组 in (" & idxs & ")"
Else If e.node.FullPath.StartsWith("按客户等级") Then
Dim sidx As Integer = e.node.FullPath.IndexOf("\")
Dim dept As String = e.node.FullPath.SubString(sidx+1)
t.Filter = "等级 like '*" & dept & "*'"
Else If e.node.FullPath.StartsWith("按客户来源") Then
Dim sidx As Integer = e.node.FullPath.IndexOf("\")
Dim dept As String = e.node.FullPath.SubString(sidx+1)
t.Filter = "来源 like '*" & dept & "*'"
End If
Else
t.Filter = ""
End If