Load Hierarchy control in a collapsed state (so the first record is not automaticall opened)

3 posts, 1 answers
  1. Phil
    Phil avatar
    6 posts
    Member since:
    Jan 2013

    Posted 16 Jan 2013 Link to this post

    For example on:  http://demos.kendoui.com/web/grid/hierarchy.html  Is there a setting (using the KendoUI ASP.NET MVC controls) that will change the initial grid loading so that the first nested record in a hierarchy grid (ie: the "Nancy" record) loads in a collapsed state.

    I attached 2 images to clarify:
    hierarchy-before.png is how it currently loads
    hierarchy-after.png is how I would like it to initially load.

    Thanks
  2. Answer
    Francois
    Francois avatar
    2 posts
    Member since:
    Aug 2004

    Posted 16 Jan 2013 Link to this post

    in the sample provided, there is a script that opens the first record:

    <script>
        function dataBound() {
            // this.expandRow(this.tbody.find("tr.k-master-row").first());
        }
    </script>

    Just comment out the code and the first recordwill remain closed.

  3. Phil
    Phil avatar
    6 posts
    Member since:
    Jan 2013

    Posted 17 Jan 2013 Link to this post

    Thank you very much Francois. I completely over looked that. I tried it and it resolved the issue.
    Cheers.
Back to Top