Results 1 to 2 of 2

Thread: TreeView

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    165

    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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width