PDA

View Full Version : TreeView Add Node Issue


Kickflipkid687
07-23-2011, 03:24 PM
I'm doing this in C#, but it might be the same in the Dotnet version in MXS, I would assume..

Basically, I am going through an array, and for each item in the array, I am adding a new node to my Treeview with the new items name and whatnot.

This works fine for the 1st array items nodes, but then when i get to my second array item, when I try to add a Node to an existing node, it doesn't do anything. However, if I add a new node to the root node/base treeview node, then it works. I can find/show a messagbox of the node I want to add to, but it just doesn't want to add....

//Check for Material Node under Object Node Added
foreach (TreeNode tn in (treeNodeObj.Nodes))
{
if (tn.Text == mat) //If we found a Material Node that matches the material name
{
// MessageBox.Show(tn.Text);
tn.Nodes.Add(treeNodeBitmap);
}
}


Edit: Well I found out how to do it, but I still need to mess with it so it works how I want it to.

bitmapTreeView.Nodes[0].Nodes[0].Nodes.Add(treeNodeBitmap);

This Adds a new Node to the 1st Child of the Root Node.

CGTalk Moderation
07-23-2011, 03:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.