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

Possible to select a note programmatically by the field id?


I have a TreeView from database in my View and I want to automatically select the note base on the ID (i_newscate_id) that pass into the View.
Is this possible?

<div style="width: 280px;">
    @Html.EJ().TreeView("NewsCate").TreeViewFields(s => s.Datasource((IEnumerable<CMSV5.ViewModels.NewsCategoryViewModel>)ViewBag.datasource).Id("i_newscate_id").ParentId("i_parent_id").Value("i_newscate_id").Text("u_title").HasChild("hasChild").Expanded("true")).LoadOnDemand(true).Width("auto").ClientSideEvents(e => e.NodeSelect("onSelect")).EnablePersistence(true)

Thank you.

1 Reply

SS Saranya Sivakumar Syncfusion Team April 13, 2015 12:36 PM UTC

Hi Jimmy,

Thanks for using Syncfusion products.

We would like to let you know that, we can select the node based on the ID that pass in to the View by using AJAX success function. We can pass the ID from the controller in to the success function of AJAX and assign that ID to the “SelectNode” API of our Treeview control as shown in the following code snippet.




url: 'DataReturn',

type: 'GET',

success: function (result) {

var treeObj = $("#NewsCate").data("ejTreeView");

treeObj.selectNode($("#" + result));




For your convenience we have prepared the sample based on your requirement and it can be downloaded from the following location.


Can you please check with the sample? If still you face any problem, kindly revert us by modifying the sample along with the replication procedure so that we can able to reproduce the issue in our end. This would be helpful for us to serve you better.

Please let us know if you have further concern.



Live Chat Icon For mobile
Up arrow icon