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

Load On Demand no childs shown => not populating child nodes

Thread ID:





116053 Mar 24,2014 09:03 PM UTC Apr 1,2014 10:03 AM UTC ASP.NET Web Forms (Classic) 3
Tags: TreeView
Georg Poweleit
Asked On March 24, 2014 09:03 PM UTC

Hi Team,

I am trying to get my TreeView running with Load On Demand. I've built it up like in the tutorial:

I think the problem is: there is no expand triangle on my root node, so the OverviewTreeData gets never called.

Here is my code:

@* Why is this? *@
@using (Ajax.BeginForm("LoadOnDemand", new AjaxOptions() { UpdateTargetId = "updatePanel" }))
    <div class="height">
    <div id="updatePanel">
        @(Html.Syncfusion().TreeView("ComponentOverview", "OverviewTreeData")
        .RequestMapper("OverviewTreeData") // This is the action Name?
        .DataSource(Model.OverviewRootNodes) // Here are my root nodes... They are shown but no expand icon
        .BindTo(bind =>
            .Children("HasChildren") // What does Children say?

        public ActionResult Index()
            OverviewViewModel model = new OverviewViewModel()
                OverviewRootNodes = new TreeViewNodeModel[] {
                    new TreeViewNodeModel() { 
                        ID = "Sensors",
                        Name = "Sensors",
                        HasChildren = true

            return View(model);

        public ActionResult OverviewTreeData(TreeViewModel treeViewModel, TreeViewItem b)
            return Json( new TreeViewNodeModel[] {
                    new TreeViewNodeModel() { 
                        ID = "Sensors",
                        Name = "Sensors"

Thanks in advance.

Ezhil S [Syncfusion]
Replied On March 27, 2014 03:51 AM UTC

Hi Georg,


Thank you for using Syncfusion products.


To create a treeview with loadondemand, prepare datasource model with Id,ParentId and text field. The Child node should have Id of the corresponding parent node in ParentId field. Please refer the following code snippet,






                         .BindTo(bind =>




public ActionResult Index()


            var data = new FirstLevelList().ListTot;

            return View(data);



        public ActionResult GetPostData(TreeViewModel treeViewModel, BaseItem b)


            var nodes = new FirstLevelList().ListTot;

            var subNodes = nodes.Where(c => c.PCode == Convert.ToInt32(b.Value));

            return new JsonResult { Data = subNodes };





Please download the sample from the following link:



Kindly let us know if you have further queries.



Ezhil S

Georg Poweleit
Replied On March 27, 2014 03:19 PM UTC

Hello Ezhil,

I am a bit confused about the tutorial. In the example you download the full datasource at the beginning.
Isn't it possible to load the Items when a tree node is opened?

First I see: (and there are no subnodes right now)
- Node1
- Node2

When I click one of the nodes, it should call the Controller and download the childs of this node.

Regards, Georg.

Ezhil S [Syncfusion]
Replied On April 1, 2014 10:03 AM UTC

Hi Georg,


Thanks for the update.


On using LoadOnDemand in TreeView only the root nodes are loaded initially in the web page. The child nodes are loaded only on expanding the root node. Please refer the attached video file in the HTML you can see that root nodes are loaded initially and child nodes are loaded only after expanding the node.


Kindly let us know if you require further assistance on this.



Ezhil S

Attachment: f116053_e648dd50.zip


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