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

Kendo UI Grid Server Detail Template Demo Problem

3 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 27 Feb 2014, 11:02 AM
Hi,
When I run the Kendo UI grid server detail template demo downloaded with my trial edition I've noticed a problem. If you open up the detail template for the second customer (Andrew Fuller) then select the 'Go to next page' button on the orders grid that template is closed and the template for the first customer (Nancy Davolio) is opened instead. This doesn't happen for the client detail template demo but I want to use my grid as per the server detail template demo. Is there a work around for this problem?
Regards,
Mark

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 28 Feb 2014, 06:53 AM
Hello Mark,

Indeed this how the demo is designed. On every page command, rebind is executed and the following action expands the first item in the page.
.RowAction(row =>
    {
        if (row.Index == 0)
        {
            row.DetailRow.Expanded = true;
        }
    })


Regards,
Nikolay Rusev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Anton
Top achievements
Rank 1
answered on 28 Feb 2014, 03:29 PM
Thanks. If I comment out the RowAction and repeat my steps the grid is redisplayed with no detail templates open. This may be no surprise but how do I alter the client code so that the detail template is still open for the second customer as you page that that customer's orders?
0
Nikolay Rusev
Telerik team
answered on 03 Mar 2014, 02:03 PM
Hello Mark,

You can see how to persist expanded item in the Server Hierarchy demo, namely:
.RowAction(row =>
{                                      
 var requestKeys = Request.QueryString.Keys.Cast<string>();
 var expanded = requestKeys.Any(key => key.StartsWith("Orders_" + row.DataItem.EmployeeID) ||
   key.StartsWith("OrderDetails_" + row.DataItem.EmployeeID));
 row.DetailRow.Expanded = expanded;       
})


Regards,
Nikolay Rusev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Anton
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Anton
Top achievements
Rank 1
Share this question
or