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 SisodiyaPosted Mar 8, 2010, 5:52 AM
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
Sam HobbsPosted Mar 9, 2010, 4:00 AM
GustavoPosted Mar 8, 2010, 8:04 AM
Yes, all my node names are unique.
Hirendra SisodiyaPosted Mar 8, 2010, 8:02 AM
i think NodeName should be unique.
GustavoPosted Mar 8, 2010, 7:49 AM
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;
GustavoPosted Mar 8, 2010, 6:20 AM
I have not found anything that I can use in that article. Thanks any ways.
GustavoPosted Mar 8, 2010, 6:16 AM
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.
Lalit MPosted Mar 8, 2010, 6:02 AM
http://www.devasp.net/net/articles/display/892.html