Rank: Member Groups: Member
Joined: 10/1/2010 Posts: 10
|
I have a treeview with on demand loading. The icons for the groups are set from a database query. I would like the items below a group display the group icon. The icons for the groups are displaying correctly, but when I try to reference parentnode.imageurl when adding the sub-nodes, it does not contain a value (although the other values associated with parentnode seem to be correct). What am I missing? I could update my query to bring back the parent icon when I get the individual items, but that doesn't seem like it should be necessary.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can try to store the image Url in the node's Value property. When you use populate on demand feature, the parent node is not a true node in your original TreeView. It is a temporarily constructed orphan node that provides you some contextual information that you can use to populate children nodes. This way it works faster because the whole node tree is not reconstructed every time you populate a node.
Because of this, the parent node does not contain all information about your original node. It only contains a few "important" properties. Of all the "important" properties, "Value" property being one that is specifically reserved for your code to use. You can store any string in that property and the TreeNode will not interpret it or use it in anyway but always keep it for you.
Thanks
|
Rank: Member Groups: Member
Joined: 10/1/2010 Posts: 10
|
OK, thanks! That worked.
|