Posted 8 February 2021, 9:45 am EST
Dear Kumar,
I change the table logic to 1 table. I think i can also be done with becasue of of the unique ID of the record. this will be than the Node ID to read.
New Code:[ul][/ul]
'create parent nodes
SqlStr1 = “Select Level_ID, Level1, Level1Text From Table1 Where Level1 > 0 Order by Level1”
For Each rstL1 As DataRow In ExecuteSQL(SqlStr1).Tables(0).Rows
Dim parentNode1 As New C1.Win.TreeView.C1TreeNode()
C1TreeView1.Nodes.Add(parentNode1)
parentNode1.SetValue(rstL1.Item(“Level1Text”), 0)
'create child1 nodes
SqlStr2 = "Select Level_ID, Level2, Level2Text From Table1 Where Level2 = " & rstL1.Item("Level_ID") & " Order by Level2Text"
For Each rstL2 As DataRow In ExecuteSQL(SqlStr2).Tables(0).Rows
Dim childNode1 As New C1.Win.TreeView.C1TreeNode()
parentNode1.Nodes.Add(childNode1)
childNode1.SetValue(rstL2.Item("Level2Text"), 0)
'create child2 nodes
SqlStr3 = "Select Level_ID, Level3, Level3Text From Table1 Where Level3 = " & rstL2.Item("Level_ID") & " Order by Level3Text"
For Each rstL3 As DataRow In ExecuteSQL(SqlStr3).Tables(0).Rows
Dim childNode2 As New C1.Win.TreeView.C1TreeNode()
childNode1.Nodes.Add(childNode2)
childNode2.SetValue(rstL3.Item("Level3Text"), 0)
'create child3 nodes
SqlStr4 = "Select Level_ID, Level4, Level4Text From Table1 Where Level4 = " & rstL3.Item("Level_ID") & " Order by Level4Text"
For Each rstL4 As DataRow In ExecuteSQL(SqlStr4).Tables(0).Rows
Dim childNode3 As New C1.Win.TreeView.C1TreeNode()
childNode2.Nodes.Add(childNode3)
childNode3.SetValue(rstL4.Item("Level4Text"), 0)
'create child4 nodes
SqlStr5 = "Select Level_ID, Level5, Level5Text From Table1 Where Level5 = " & rstL4.Item("Level_ID") & " Order by Level5Text"
For Each rstL5 As DataRow In ExecuteSQL(SqlStr5).Tables(0).Rows
Dim childNode4 As New C1.Win.TreeView.C1TreeNode()
childNode3.Nodes.Add(childNode4)
childNode4.SetValue(rstL5.Item("Level5Text"), 0)
Next
Next
Next
Next
Next
The Problem still with onMouseClick, Up and Down Cursor and how to Show the pdf on the Right side…
Best regards
Said
DemoData_New.zip