Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TreeView Control Question
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
TreeView Control Question
Miscellaneous
Thread ID:
01312764
Message ID:
01312764
Views:
60
I'm adding nodes to a treeview and I'm trying to set the images:
private void _SetupTreeView()
{
    
    TreeNode oRoot = new TreeNode();
    oRoot.Name = "nodRoot";
    oRoot.Text = "Advocate";
    oRoot.ImageKey = "advocate";
    treeView1.Nodes.Add(oRoot);

    TreeNode oNode = new TreeNode();
    oNode.Name = "nodCustomers";
    oNode.Text = "Customers";
    oNode.ImageKey = "customers";
    oRoot.Nodes.Add(oNode);

    oRoot.Expand();

}
This all runs fine, except that when I select the second node, the icon changes to the root node's icon. When I select the root node again, the customer node's icon returns to Customer.

Anyone know what I'm doing wrong here?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Reply
Map
View

Click here to load this message in the networking platform