Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
how to set treeview child nodes of child nodes of child nodes ... etc.. in loop
giangurgolo
Jan 25 2008 1:04 PM
25.1k
Reply
I am doing a foreach loop where I add nodes to a treeview control. When
TreeNode treeNode;
foreach (Item item in stuff)
{
treeNode = this.TreeView.Nodes.Add("label");
}
What I want to do is put a conditional in the loop that, if true, it adds any following nodes in the loop as child nodes to that treeNode where the conditional is true. I can do this for a single occurence where the conditional is true, but how can I do it if it is true WITHIN a node that is already a child? Ie. make a child node of a child node of a child node and so on... instead of doing it manually like Nodes.Nodes.Nodes.Nodes. etc...
Thanks
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Refresh Data on Parent Form1
Create a calendar