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

6 posts, 0 answers
  1. AkAlan
    AkAlan avatar
    121 posts
    Member since:
    Jun 2009

    Posted 20 Dec 2012 Link to this post

    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?
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 24 Dec 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. AkAlan
    AkAlan avatar
    121 posts
    Member since:
    Jun 2009

    Posted 24 Dec 2012 Link to this post

    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?
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 26 Dec 2012 Link to this post

    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!
  6. Shawn
    Shawn avatar
    30 posts
    Member since:
    Mar 2011

    Posted 30 Dec 2012 Link to this post

    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

  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Dec 2012 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready