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

How expand a single row

1 Answer 620 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Xavier
Top achievements
Rank 1
Xavier asked on 10 May 2016, 04:39 PM

Hello,

I need collapse the rest of de expanded rows when the user expand a new row and scroll this row to the top position of the grid. I have tried with the next code unsuccessfully.

 

Html.Kendo().Grid<ProductorViewModel>().Name("productors")

    ......

.Events(e => e
            .DataBound("onDataBound")
            .DetailInit("onDetailInit")
            .DetailExpand("onExpand")
        )

.....

 

<script type="text/javascript">

        function onExpand(e) {
            var grid = $("#productors").data("kendoGrid");
            var dataView = this.dataSource.view();
            var model = e.data;
            for (var i = 0; i < dataView.length; i++) {
                var uid = dataView[i].uid;
                if (uid != model.uid) {
                    var tr = $("tr[data-uid=" + uid + "]");
                    grid.collapseRow(tr);
                }
            }
        }

</script>

 

Can you help me with some example?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 May 2016, 03:30 PM
Hi Xavier,

See the forum thread below that provides possible solutions for your requirements:
http://www.telerik.com/forums/grid-rows-collapsed-on-grouping-

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Xavier
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or