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

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

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.

3 Replies

ES Ezhil S Syncfusion Team 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

GP Georg Poweleit 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.

ES Ezhil S Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon