I am trying to find the selected node in a TreeView on the client side.
I have tried the code in this example which is linked to in a similar thread listed here.
I am not able to figure out what I am doing wrong. When calling GetSelectedNodes() I contiune to get the error message "Object does not support this property or method". I have tried setting MultiSelect = true and false with the same error.
Here is a sample of my code.
<body> |
<script type="text/javascript"> |
function getSelectedNodes() |
{ |
var tree = <%= RadTreeView1.ClientID %>; |
var nodes = tree.GetSelectedNodes(); |
alert(nodes.length); |
} |
</script> |
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<telerik:RadTreeView ID="RadTreeView1" runat="server"> |
<Nodes> |
<telerik:RadTreeNode runat="server" Expanded="True" Text="1" Value="1" /> |
</Nodes> |
</telerik:RadTreeView> |
<input id="Button1" type="button" value="Get Selected Node" onclick="getSelectedNodes();" /> |
</form> |
</body> |
Justin