Rank: Advanced Member Groups: Member
Joined: 8/27/2007 Posts: 44
|
Hello,
When I click on a treenode, in the itempopulate server event, I can access the parentnode of the clicked node, but when I expand a node (using the +), I cannot access the parentnode in itempopulate event.
In fact, clicking on a treenode seems to first trigger itempopulate events for the root node down to the clicked node, before generating the itemclicked event, while expanding a treenode only triggers an itempopulate event of the clicked node.
How can I access the parentnode in a itempopulate event triggered by expanding a node ?
This is with v 4.0.34.2 of the dll, on ASP.NET 2.0. The treeview is inside a e.o. callback panel. RaisesServerEvents is true.
Best Regards, Alexis
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You will not be able to. The purpose of ItemPopulate is to provide the best performance to work with large tree, thus it never constructs the whole tree in memory. When ItemPopulate is called, the node that is passed to you is an orphan node, the sole purpose of that node is to provide some information so that you will know which node is being populated. For this reason you will need to rely solely on information in that node (for example, Text, ItemID, Value, etc) to determine how to populate.
Thanks
|