Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

TreeList does not display hierarchical data even though datasource is set

$
0
0

I have a ​TreeList that simply does not display the data it is receiving through the remote binding.

I can confirm (via Fiddler AND the KendoUI for Chorme browser extension) that the JSON data received is loaded and does contain data. However, the tree list does not display it.

I can't seem to figure out why. Please see attached images.

I also tried turning AutoBind ON/OFF, ServerOperation ON/OFF. Nothing helps. I don't see what's wrong with it.

 

View:

            @(Html.Kendo().TreeList<Web.Models.LevelViewModel>()
                  .Name( "treelist1" )
                  .Columns( columns =>
                  {
                      columns.Add().Field( e => e.Name );
                  } )
                  .DataSource( dataSource => dataSource
                       .Read( read => read.Action( "Load", "Business" } ) )
                       .ServerOperation( false )
                       .Model( m =>
                       {
                           m.Id( f => f.Id );
                           m.ParentId( f => f.ParentId );
                           m.Expanded( true );
                           m.Field( f => f.Name );
                       } )
                  )
                  )

Controller:

            var result = controllerService.BuildLevel​s( 1 );
            return Json( result.ToTreeDataSourceResult( request,
                e => e.Id,
                e => e.ParentId
                ), JsonRequestBehavior.AllowGet );

 Model:

    public class LevelViewModel : ViewModelBase
    {
        public int Id { get; set; }
        public int? ParentId { get; set; }
        public string Name { get; set; }
        public int FunctionId { get; set; }
        public int LevelId { get; set; }
    }

  

 

Can you please help?


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>