Children are not shown in TreeView

2 posts, 0 answers
  1. Gil
    Gil avatar
    9 posts
    Member since:
    Jun 2016

    Posted 28 Sep Link to this post

    I made an update of the UI for ASP.NET MVC. Now, in the tree view only the root is shown and no longer any child.

    The view is as follows:

                    @(Html.Kendo().TreeView()
                                  .Name("treeviewInner")
                                  .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.TreeViewContent) 
                    )
    Here is the code in the controller:

            private List<TreeViewItemModel> GetTreeViewData()
            {
                var items = new List<TreeViewItemModel>()
                {
                    new TreeViewItemModel()
                    {
                        Text = "0",
                        Items = new List<TreeViewItemModel>()
                        {
                            new TreeViewItemModel()
                            {
                                Text = "1"
                            }
                        }
                    }
                };

                return items;
            }

            public ActionResult TreeViewContent(int wbsHeaderId)
            {
                ViewBag.TreeViewContent = GetTreeViewData();
                return PartialView();
            }

  2. Gil
    Gil avatar
    9 posts
    Member since:
    Jun 2016

    Posted 28 Sep in reply to Gil Link to this post

    I found a solution by myself. The problem was that the path for the scripts has changed.
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top