Treeview in ASP.Net 2.0...javascript and selected node

G

Guest

Hi there,

Does anyone know how to get the selected node from a ASP.Net 2.0 TreeView in
Javascript? I used to be able to get it in the old webcontrols one, but now
the properties have changed and I can't seem to figure it out.

Thanks,

Wes
 
G

Guest

The TreeView creates an object in Javascript on the client side that's called
[treeview name]_Data
i.e., if the treeview is named tvNavigation, the object's name would be
tvNavigation_Data
This object has a property called selectedNodeID. This property has a ...
property called value that contains the id of the currently selected node. So

var name = tvNavigation_Data.selectedNodeID.value;
var selectedNode =
Document.all?Document.all[name]:Document.getElementById(name);

will get a reference to the currently selected node.
 
Joined
Jul 3, 2006
Messages
1
Reaction score
0
hi

Hi ,
i populate the tree view with the populate on demand event , as you specified in the last replay , i just follow the steps to implemet the script but i got only the null values in the object name ....so i can't get the tree selected node values .. pls help me

example
var name = tvNavigation_Data.selectedNodeID.value;
alert (name) -- it's retun the null value

regards ,
sankar
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top