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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Possible to select a note programmatically by the field id?

Thread ID:





118797 Apr 10,2015 04:48 AM UTC Apr 13,2015 12:36 PM UTC ASP.NET MVC 1
Tags: TreeView
Jimmy Soh
Asked On April 10, 2015 04:48 AM UTC


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.

Saranya Sivakumar [Syncfusion]
Replied On 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.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon