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

Select node from server side

Is there a way to select a node from server side?

1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team June 8, 2017 06:54 AM UTC

Hi Armand,   
Thanks for contacting Syncfusion support.   
We can use SelectNode and SelectedNodes properties of TreeView to select node/nodes in the TreeView from server side. Please check the below code snippets.   
[Server Side] 
protected void Button1_Click(object Sender, Syncfusion.JavaScript.Web.ButtonEventArgs e) 
{ 
      // Pass the index value to selected nodes API 
      int[] array = { 1, 2, 3, 4, 5 }; 
      //should enable AllowMultiSelection API to select more than one nodes in treeview 
      this.TreeView1.SelectedNodes = array.ToList();  
} 
 
 
For your reference, we have prepared a simple sample, please check the sample in below location. 
 
 
Please let us know, if the provided informations are helful or not. 
 
Regards, 
Ashokkumar B.  


Loader.
Live Chat Icon For mobile
Up arrow icon