blah blah blah is here! blah blah » Close

up1down
link

I am trying to search for a name of a specific node in a TreeView and add a node under that one, but I'm not sure how.

Here's what I came up with:

TreeNode[] addonNode = myTreeView.Nodes.Find("abc", true);


After I did that I expected to be able to go ahead and do addonNode.Add("cba") but apparently not. Is there another way of doing what I am trying to do?

Mort
15

addonNode is an array, you can add a node to any of the elements.

last answered 2 years ago

1 answers

up1down
link

Assuming there's only one node called "abc" then it will be the only element of the addonNode array. You then need to add the new node to its Nodes collection:

addonNode[0].Nodes.Add("cba", "cba");

Feedback