窗口事项内 e.Form.Controls("TreeView1").BuildTree("A", "报岗类型|报岗站") 双击节点后执行 Dim Filter As String If e.node.Text = "加载所有数据" Then Filter = "" Else Dim dr As DataRow = e.Node.DataRow '获取生成此节点的DataRow Select Case e.Node.Level Case 0 Filter ="[报岗类型] = '" & dr("报岗类型") & "'" Case 1 Filter ="[报岗类型] = '" & dr("报岗类型") & "' And [报岗站] = '" & dr("报岗站") & "'" End Select End If DataTables("A").LoadFilter = Filter DataTables("A").Load()
表A 是个查询表
在双击节点时提示 此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据
|