This is a migrated thread and some comments may be shown as answers.

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

2 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 16 Jan 2013, 03:21 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Francois
Top achievements
Rank 1
answered on 16 Jan 2013, 10:51 PM
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.

0
Phil
Top achievements
Rank 1
answered on 17 Jan 2013, 05:07 PM
Thank you very much Francois. I completely over looked that. I tried it and it resolved the issue.
Cheers.
Tags
Grid
Asked by
Phil
Top achievements
Rank 1
Answers by
Francois
Top achievements
Rank 1
Phil
Top achievements
Rank 1
Share this question
or