Dim Filter As String Dim Value()As String Value = e.Node.FullPath.Split("\\") Select Case e.Node.Level Case 0 Tables(e.Node.Text).Filter = "" MainTable = Tables(e.Node.Text) DataTables.AllowEdit = True Case 1 \'得到单据审批记录表中未结束的父节点表单的编号 Dim nms As String nms = DataTables("单据审批记录").GetComboListString("编号","表名= \'" & e.Node.ParentNode.Text & "\' and 结束 = false") If nms > "" Then nms = "\'" & nms.replace("|","\',\'") & "\'" \'从系统表中得到当前父节点的表使用的单据编号列的名称,然后过滤得到编号在单据审批记录中的表. Dim dr As DataRow = DataTables("系统表").Find("表名 = \'" & e.Node.ParentNode.Text & "\'") If dr IsNot Nothing Then Dim num As String = dr("单据编号列") Tables(e.Node.ParentNode.Text).Filter = dr("单据编号列") & "In (" & nms & ")" MainTable = Tables(e.Node.ParentNode.Text) DataTables.AllowEdit = True End If End If End Select