Treeview Tutorial

Does anyone know or aREAL tutorial on Treeview. Not loading ado, xml, directories, etc. I mean one thatexplains the properties of the Treeview control. The above is about all I can find on the internet.

What I am trying to do is add a node to the treeview in a predetermined location. I then want to add two sub-nodes to the one just entered.

DimoNodeAsNewTreeNode

oNode.Name ="Level1"

TreeView1.Nodes.Add(oNode)

TreeView1.SelectedNode.Name =oNode.Name==> Getting error here

TreeView1.Nodes.Add("Level1a")

TreeView1.Nodes.Add("level1b")

oNode =Nothing

The error is "NullReferencException was unhandeled." and "Object reference not set to an instance of an object."

Any tutorial on this subject would be greatly appreciated.

[1756 byte] By [WayneSpangler] at [2007-12-16]
# 1
wayne your close... The treeview is a pain in the but I can say that, but to do what you want try to mess with the following code:


private sub createlevel1()
{
Dim node as New TreeviewNode
node.text = "level 1"
Treeview1.Nodes.Add(node)
}
private sub createlevel2()
{
Dim node as new TreeviewNode
node.text = "Level 2"
Treeview1.SelectectedNode.Nodes.Add(node)
}


Now what this will do is it will create a Level 1 node and then when you select that node and run the other method it will create a level 2 node under that. I hope this gives you some idea on how to use this control.
wacko at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
Thanks wacko, I appreciate it.
WayneSpangler at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...