Quote Originally Posted by Mattpstanding View Post
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...