This is a migrated thread and some comments may be shown as answers.

Hierarchical treeview binding issue

1 Answer 9 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
Dayana Maliyakal
Top achievements
Rank 1
Dayana Maliyakal asked on 14 Feb 2014, 11:56 AM
Hi,

I have a treeview as following:

View

<script type="text/javascript">
 
function onDataBinding(e) {
var StatusID = $("#rcbProject").data("tComboBox").value();
$.ajax({
url: "/ucProject1/test?StatusID="
+ StatusID,
data: {},
success: function (data) {
var treeview = $("#rtvProject").data("tTreeView");
treeview.bindTo(data);
}
});
}
</script>

<%=Html.Telerik()
.TreeView()
.Name("rtvProject")
.ExpandAll(true)
.ClientEvents(events =>
{
events.OnDataBinding("onDataBinding");
})
%>


controller

public JsonResult test(int StatusID)
{
 
 DataTable dt = new DataTable();
 dt = GetItems(0, StatusID);
 var result = (from DataRow dr in dt.AsEnumerable()
 select new
 {
 Value = dr["ProjectID"],
 Text = dr["ProjectDisplayName"]
 }).ToArray();
 
 return Json(result, JsonRequestBehavior.AllowGet);
}


It is working.But I really need a hierarchical treeview.I want to add ParentID also other than Value and Text. Based on ParentID tree should  display.How this possible?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Feb 2014, 10:47 AM
Hello Dayana,

The Telerik MVC Extensions that you are using are no longer supported. Consider migrating to KendoUI Extensions for ASP.NET MVC:

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/migration/migrating-from-telerik-extensions-for-aspnet-mvc

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
AJAX and Web 2.0
Asked by
Dayana Maliyakal
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or