|
-
May 12th, 2008, 10:03 AM
#1
c# treeView help?
I'm using an arraylist to store an array like...
files.Add(new StoredFile(nodeTitle, nodeName, parentNode));
I'm trying to add each element of the arrayList to the treeview using a loop.
foreach (StoredFile f in files)
{
if (f.gsParentNode.Equals(mainNode.Name))
child = addTreeNode(child, mainNode, f);
MessageBox.Show(child.Name.ToString())
...
private TreeNode addTreeNode(TreeNode newNode, TreeNode rootNode, StoredFile f)
{
newNode = new TreeNode();
newNode.Name = f.gsFileName;
newNode.Text = f.gsTitle;
rootNode.Nodes.Add(newNode);
return newNode;
}
If I'm adding child nodes to mainNode from the array list. Is there a way of looping through all child nodes to check whether any of them are a parent of another node, which is to be added?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|