We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

treeview node inside generic dropdown

Hi I use a generic drop down and inside that i use a treeview .each treeviewnode has a ID,Value,Text.when i click the dropdown,the tree appears.when i click a particular node,i call the code genericdropdown1.SetText(treeNode.ValuPath);document.getElementById("HSelectedNode")=treeNode.Value;

I have a button(html) .when i click that button,i want to select a particular tree node in the drop down.i have the value of node to be selected with me.i want to traverse all the nodes and check the value of each node and if it matches i want to select that node (at client side) how can i do that?

1 Reply

VA Valli Syncfusion Team April 2, 2007 11:49 AM UTC

Hi Sujith,

I am afraid that it is not possible to select the TreeViewNode at the client side.

Meanwhile the below is a sample link, which selects a TreeviewNode based on its value without triggering a postback.

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F58950/main.htm

1. 'Onclick' event of the button 'btnClick', displays a Textbox which is used to enter the value of the TreeViewNode and a HTML button 'btnSelect'.
2. 'Onclick' event of the 'btnSelect' triggers a serverside callback, which traverse the TreeViewNode to check whether the value of the TreeViewNode matches the value entered in the Textbox.
3. If the value of the TreeViewNode matches the Textbox value, the corresponding node is selected.

Please try running the sample and let me know if this helps you.

Regards,
Valli

Loader.
Live Chat Icon For mobile
Up arrow icon