TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
giangurgolo
NA
6
0
how to set treeview child nodes of child nodes of child nodes ... etc.. in loop
Jan 25 2008 1:04 PM
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
Reply
Answers (
4
)
Refresh Data on Parent Form1
Create a calendar