Hello,
I have been working with the treeview control from Microsoft.
Here is what I want to do:
I have a function that returns a string:
private string generateNodeString(ArrayList array) {
string ReturnVar = "myTreeview.Nodes[0]";
int i;
for (i=1;i<array.Count-1;i++) {
ReturnVar += ".Nodes[" + array[i].ToString() + "]";
}
return ReturnVar;
}
this would return me a "string" in the format of:
myTreeview.Nodes[0].Nodes[0].Nodes[0].Nodes[3]
I am then trying to pass this string in as an argument of a
treeNode.Add function (that part is already working).
private void AddTreeNode(TreeNodeCollection nodes, string nodeText,
string url)
{
nodes.Add(Node(nodeText, url));
}
private TreeNode Node(string text, string url)
{
TreeNode n = new TreeNode();
n.Text = text;
n.NavigateUrl = url;
return n;
}
how do i pass the string in, and make the system recognize it as a
Treenode (treecollection object)?
any help would be appreciated.