Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")
nd = tr.SelectedNode
If nd IsNot Nothing Then
If nd.Level = 2 Then
MessageBox.Show("最多允许三层节点!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Dim dr As DataRow = DataTables("工资摘要").AddNew
dr("代码") = DataTables("工资摘要").Compute("max(代码)", "摘要 = '" & dr("摘要") & "'") + 1
dr("摘要") = nd.Text
dr("摘要") = "新节点"
nd = nd.Nodes.Add("新节点")
tr.SelectedNode = nd
tr.Select()
tr.BeginEdit()
End If
End If
如何插入代码? dr("代码") = DataTables("工资摘要").Compute("max(代码)", "摘要 = '" & dr("摘要") & "'") + 1
dr("摘要") = nd.Text
不能准确插入代码?