|
-
Jun 7th, 2019, 04:09 PM
#3
Re: Treeview fun!
 Originally Posted by Mattpstanding
I think I might have got it.
When adding the parent node to the treeview I was only adding the text and not the key. By specifiing the and the name:
Code:
parent="Top Level"
TreeView1.Nodes.Add(parent, parent)
Code:
Dim myNodes() As TreeNode = TreeView1.Nodes.Find(parent, True)
If Not sqldatareader.Item(0) Is DBNull.Value Then
myNodes(0).Nodes.Add(sqldatareader.Item(0).ToString, sqldatareader.Item(0).ToString)
End If
This seems to now dynamically build the correct tree structure.
You're right. That's how to do exactly what you asked. No trickery, simply a case of using a key on each node...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|