Hello:
After I add a NodeText how do I add the Text and Tag to the same Node?
This is the line that I have to add the NodeName:
treeViewICEPack.Nodes.Add(NodeText);
Now I want to add the Name and Tag to the one just added. How do I do that? I looked for something like 'Selected' but cant find it. I am probably not looking in the right place.
Loading

Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 8, 2010, 12:52 AM EST
you can add two things for adding new node ,key and text like this
TreeView1.Nodes.Add("Key1", "Text")
and then you can add tag and text property like this
TreeView1.Nodes("Key1").Tag = "Tag"
TreeView1.Nodes("Key1").Text = "NewText"
thank you
check accepted answere if you like
Lalit MRank #1,186 · 1.5K reputationPosted Mar 8, 2010, 1:02 AM EST
http://www.devasp.net/net/articles/display/892.html
GustavoRank #1,990 · 732 reputationPosted Mar 8, 2010, 1:16 AM EST
The line: TreeView1.Nodes.Add("Key1", "Text") , works... thanks.
However, the line: TreeView1.Nodes("Key1").Tag = "Tag" , does not work. The .Tag is a problem.
GustavoRank #1,990 · 732 reputationPosted Mar 8, 2010, 1:20 AM EST
I have not found anything that I can use in that article. Thanks any ways.
GustavoRank #1,990 · 732 reputationPosted Mar 8, 2010, 2:49 AM EST
I found out how to do it. I used Hirendra and added something.
Code original:
treeViewICEPack.Nodes.Add(NodeText).;
Code after:
treeViewICEPack.Nodes.Add(NodeName, NodeText);
Code changed to:
treeViewICEPack.Nodes.Add(NodeName, NodeText).Tag = NodeTag;
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 8, 2010, 3:02 AM EST
i think NodeName should be unique.
GustavoRank #1,990 · 732 reputationPosted Mar 8, 2010, 3:04 AM EST
Yes, all my node names are unique.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 8, 2010, 11:00 PM EST