building treeview

Posted by DJPlayer on Stack Overflow See other posts from Stack Overflow or by DJPlayer
Published on 2012-09-21T15:36:56Z Indexed on 2012/09/21 15:37 UTC
Read the original article Hit count: 149

Filed under:
|

I'm dynamically building a treeview given numerous stored procedures.

the structure goes like this:

    OwnerRPColl.Search2()

    For Each root As OWNER_RP In OwnerRPColl
        Dim nd_Root As New TreeNode
        nd_Root = TreeView1.Nodes.Add(root.OWNER_RP_BUSNS_NAME)
        bldg.ID = root.ID

        bldgColl.Search(bldg.ID)

        For Each firstChild As BLDG In bldgColl
            Dim nd_lvl_One As New TreeNode

            With nd_lvl_One
                .Text = firstChild.BLDG_NAME_1
                .Tag = firstChild.ID
            End With

problem being is that I need to have labels for these.. meaning the first level of the treeview needs to say "users" when expanded displays users. Each of these users can have a building. The world building needs to be the example option, which then displays the building.. essentially I need a slick way to add the word in for the expanding level (instead of the value in the collection).

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about treeview