RadGrid maintain scroll position after row selection

10 posts, 0 answers
  1. Shawn
    Shawn avatar
    14 posts
    Member since:
    Dec 2012

    Posted 28 Apr 2015 Link to this post

    I have a RadGrid that has a WebUserControl for each row of the grid to allow the user to edit that row. When I click the edit button to expand the row (this opens up a .ascx control within the grid for that row), it always scrolls to the top of the page. The user then has to scroll down to find the row they selected with the row expanded to begin editing that row.

     I found in another post that adding RadGrid1.ClientSettings.AllowKeyboardNavigation = true;prior to data binding the grid helps to maintain scroll position. This kind of works and you only have to scroll down one click of the mouse wheel to find the row to edit; not good enough.

    I also have set MaintainScrollPositionOnPostback=“true" on the aspx page.

    I also have set on the RadGrid itself under client settings SaveScrollPosition=“true".

    What I'd like to see is the page not move at all when the user clicks on edit for the given row. I would like to maintain the scroll position on the page.

    Can this be accomplished? If so, how?

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 29 Apr 2015 Link to this post

    Hello,

    I have prepared a sample page where I set the MaintainScrollPositionOnPostback property of the Page to true and as you can see the browser scroll maintain its position when I click edit. You can find my test page attached to this message and modify it in order to replicate the described problem, so we can investigate the case further.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shawn
    Shawn avatar
    14 posts
    Member since:
    Dec 2012

    Posted 30 Apr 2015 in reply to Pavlina Link to this post

    Pavlina thank you for the demo project.  I tried out your product and I'm sad to say that it does not maintain scroll position.  I scrolled down the page, clicked edit and after postback I'm back at the top of the page.  I tried in the latest version of Chrome, Firefox and IE11.

     

    Thoughts???

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 05 May 2015 Link to this post

    Hi,

    Could you specify which is the version of Telerik UI controls you are using to test the scrolling? I tested the attached project with the latest version of the controls and the scrolling maintain after edit is clicked.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Shawn
    Shawn avatar
    14 posts
    Member since:
    Dec 2012

    Posted 07 May 2015 in reply to Pavlina Link to this post

    I'm using a product version for the Telerik.Web.UI.dll of 2014.3.1209.45.  I will try the latest version and let you know if that works.  Thanks,
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 07 May 2015 Link to this post

    Hi,

    If the problem in your application persists even with the latest version, isolate it in a sample project or modify the one I sent you in order to replicate the issue and send it to us. We will test it locally and will advice you further how to resolve it.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  8. Shawn
    Shawn avatar
    14 posts
    Member since:
    Dec 2012

    Posted 07 May 2015 in reply to Pavlina Link to this post

    I tried the latest and still jumps me to the top of the page.  I'm using the Northwind DB from a sql perspective instead of a file like you provided.  Check the web.config and change accordingly.  How can I send you the zipped file?

     

    Thanks,

  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 11 May 2015 Link to this post

    Hi,

    In order to persist the scroll position you can follow the approach described here: http://www.aspsnippets.com/Articles/Maintain-Scroll-Position-of-DIV-on-PostBack-in-ASPNet.aspx

    The idea is to store the scroll position in a hidden field and reapply it after the postback. Give it a try and in case this solution is also not working for you, open a formal support ticket where you will be able to attach zip file and send it to us.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  10. Shawn
    Shawn avatar
    14 posts
    Member since:
    Dec 2012

    Posted 11 May 2015 in reply to Pavlina Link to this post

    I submitted ticket 934177.  Thanks
  11. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 12 May 2015 Link to this post

    Hello,

    To prevent multiple posts let's continue our conversation in the support ticket.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017