How to get Client ID of a TreeNode in a Treeview?

M

Magnusb

I need to be able to get the id of a node in a treeview in a client
script. When the user expand a node I want to run a script (ie innjetc a
client side script from server side) which will scroll to that node.

Don't know how to get the client side ID of a tree node since there is
no ClientID for tree node objects.
 
J

Justin Dutoit

Hi. I found on my Treeview that if you expand all nodes on the treeview,
you'll find that the nodes (the <a> tags at least) are called
TreeViewIdtX
where X is the index. The index for the first node is 0, then 1, 2, etc. So
if you have a TreeView called Vehicles:

Cars
Fords
Taurus
Focus
Chevys
Corvette

The node for Focus will be Vehiclest3 and the node for Chevys will be
Vehiclet4 etc etc.

HTH,
Justin Dutoit.
 
M

Magnusb

Hi. I found on my Treeview that if you expand all nodes on the treeview,
you'll find that the nodes (the <a> tags at least) are called
TreeViewIdtX
where X is the index. The index for the first node is 0, then 1, 2, etc. So

Yes, I found that later as well. But thank you for replying anyway. Was
hoping I was missing something and there was an easier method (like some
simple way to get the client ID). But both and you have come to the same
conclusion so I guess this should work. I have seen som other
suggestions but they were more complicated to do.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top