How would you add elements in TreevieW Control.

Showing Answers 1 - 2 of 2 Answers

k.padmanabha rao

  • Jun 20th, 2005
 

treeview.nodes.add ([Relative],[Relationship],[key],[text],[image],[selectedimage]) as node

  Was this answer useful?  Yes

Sangita Margabandu

  • Sep 17th, 2006
 

Private Sub Form_Load()
Call connect_db
'For displaying parent nodes
If rs.State = 1 Then rs.Close
sql = "select * from org_mst"
rs.Open sql, con, adOpenKeyset
Do While rs.EOF = False
If rs!parent_id = 1 Then
    tvwOrg.Nodes.Add , , "A", rs!Name
Else
    If rs!parent_id = 2 Then
        tvwOrg.Nodes.Add , , "B", rs!Name
    Else
        tvwOrg.Nodes.Add , , "C", rs!Name
    End If
End If
rs.MoveNext
Loop

'For displaying the child nodes

If rs.State = 1 Then rs.Close
sql = "select * from org_det"
rs.Open sql, con, adOpenKeyset
Do While rs.EOF = False
If rs!parent_id = 1 Then
    tvwOrg.Nodes.Add "A", tvwChild, , rs!child_name
Else
If rs!parent_id = 2 Then
    tvwOrg.Nodes.Add "B", tvwChild, , rs!child_name
Else
    tvwOrg.Nodes.Add "C", tvwChild, , rs!child_name
End If
End If
rs.MoveNext
Loop

End Sub

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions