|
-
Mar 28th, 2009, 09:35 AM
#1
Thread Starter
Addicted Member
TreeView
Hello,
How can i programmatically create a treeview consisting of several nodes and each node has several children.
I want to read the nodes and children from a table and fill them accordingly, so how can i do this?
thank you
Hiba
-
Mar 28th, 2009, 09:52 AM
#2
Re: TreeView
Creating a TreeNode object is just like creating any other object, i.e. invoke a constructor with the New key word and then set the appropriate properties. You can then Add that TreeNode to the Nodes collection of a TreeView or another TreeNode.
As is usually the case, I would suggest that you create your populated TreeView in the designer and then look at the code that gets generated. You can then write similar code.
You might also like to take a look at this. It might not be exactly what you want but it won't be far off, so adapting to your needs shouldn't be too hard.
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
|