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

How do I Select row, leave page, return to last selected row in a grid

5 Answers 171 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AkAlan
Top achievements
Rank 2
AkAlan asked on 20 Dec 2012, 11:09 PM
I have a Kendo grid with a Select command on each row that brings the user to another detail view. From the Detail view, I want to be able to return to the grid and have the same row selected. The current behavior takes me back to the first row of the grid. Are there any examples I can see that behave the way I need?

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Dec 2012, 01:23 PM
Hi Alan,

 You can check this code library project: http://www.kendoui.com/code-library/web/grid/preserve-grid-state-in-a-cookie.aspx

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AkAlan
Top achievements
Rank 2
answered on 24 Dec 2012, 09:53 PM
Hi Atanas, thanks for the demo script. I'm using Kendo UI from MVC and I'm not sure which would be easier, change the code for the grid to be just Kendo UI as in your example or trying to make your example work with my existing grid. Do you happen to have a similar example that uses Kendo UI form MVC? Also, I do not have multiple/rows enabeld on my grid, would that have any impact on the code?
0
Atanas Korchev
Telerik team
answered on 26 Dec 2012, 08:14 AM
Hi Alan,

 No, we don't have an example for the MVC version of the grid. It should be however easy to use that code in your project. The important bits are in the dataBound and change event handlers which are both exposed in the MVC wrapper. 

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Shawn
Top achievements
Rank 1
answered on 31 Dec 2012, 01:21 AM
I am curious how this should work too. I expected there to be an option or a solution that involved keeping data in the URI (e.g. after the "#" value). In most cases I am just interested in the paging (when paging is enabled) and the row number. This sort of page state is commonly stored in the URI these days. Cookies seems way overkill.

For example, as I click on a row, I'd love my URI to look like this:

http://mysite.com/mypagewithgrid#page=5&row=10

0
Atanas Korchev
Telerik team
answered on 31 Dec 2012, 09:28 AM
Hello Shawn,

 A similar thing would happen if server binding is used. Then the MVC grid uses HTTP GET requests to do paging and that information is part of the query string.

 Adding state to the URL of the grid is not currently supported in other binding modes and configurations. Feel free to suggest it in our feedback portal!

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