Page scroll goes top after an ajax update

8 posts, 1 answers
  1. Plamen
    Plamen avatar
    41 posts
    Member since:
    Feb 2008

    Posted 11 Feb 2010 Link to this post

    Hello, Telerik Team and Community!
    I need your help.

    I have a problem with RadAjaxPanel. I put two separate RadGrids in it. The second RadGrid has a button on every row to update a quantity value, entered in a RadNumericTextBox. Whenever I update this quantity, the scroll goes up, and it goes not to the beginning of the page, but to the point where the Ajax Panel begins.

    This is kind of strange behavior and thus our users lose the interactivity Ajax has to offer.

    I've read about this being reported as bug back in 2008. Now it's 2010 and still encounter the same problem.
    So, what should I do to avoid it?

    Thanks,
    Plamen Petrov
    Application Software Systems
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 11 Feb 2010 Link to this post

    Is the problem that the page is actually going to the top of the RadAjaxPanel or is it the RadGrid's scroll area that is going to the top after the Ajax request. If it's the RadGrid you should set the SaveScrollPosition="true" from the ClientSettings.Scrolling settings.

    I don't know if that's what you're asking because I'm assuming the second RadGrid control you mention is under the first, thus my suggestion is totally wrong, but if it's above the first than I think that should solve the scroll problem.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 11 Feb 2010 Link to this post

    Hi Plamen,

    Please examine the following help article, which elaborates on this subject and let me know if it works for you:
    http://www.telerik.com/help/aspnet-ajax/ajxpanelscrolltotop.html

    I hope this helps.

    Greetings,
    Pavlina
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  5. Plamen
    Plamen avatar
    41 posts
    Member since:
    Feb 2008

    Posted 12 Feb 2010 Link to this post

    Robertw102, I have two RadGrids and the problem is in the vertical scroll of the browser, I don't use scrolling in any of the grids. Whenever the page becomes longer, when I make an update it would go to the top of the RadAjaxPanel. However, thank you for your answer, I appreciate it, next time I will be more specific with my explanation.

    Pavlina, I read trough this topic before writing here and I don't see how it helps me. I want the page to stay where the ajaxified control is, not go to the top of the page. That as far as I know should be the norm when using RadAjaxPanel, but alas it isn't in my case. So, my problem isn't solved.

  6. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 17 Feb 2010 Link to this post

    Hello Plamen,

    I noticed that you have opened a duplicate post on the same matter. Please, refer to the other support ticket post for additional information. To avoid duplicate posts, we can continue our communication there.

    However, attached to this message is a simple working application, which is working as expected. Please give it and let me know if it works for you.

    Regards,
    Pavlina
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  7. Plamen
    Plamen avatar
    41 posts
    Member since:
    Feb 2008

    Posted 19 Feb 2010 Link to this post

    Hello, Pavlina!

    Thank you for your example! You should know I was unable to run it, because i got the following exception:

    System.Data.SqlClient.SqlException: The database 'C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\RADAJAXPANEL\APP_DATA\NORTHWIND.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported. 
     

    It's some sort of compatibility issue on Microsoft's part, but I thought you would like to know about it (in case you didn't).

    However, I resolved the issue after looking at the code of your sample and then completely reviewing my code. It turned out that another control on the page was stealing focus, so this was why browser scroll bar moved the to the top (that was also where the RadAjaxPanel started by coincidence).

    Thanks again!
    Best,
    Plamen Petrov
    Application Software Systems
  8. Josef
    Josef avatar
    1 posts
    Member since:
    Jul 2013

    Posted 05 Jul 2013 Link to this post

    Hi Plamen!
    Im having a similar issue.
    I hava a few textboxes at the top of my page followed by 2 grids and a treelist at the bottom. Both the grids and the treelist have controls inside them which cause ajax-postbacks. After the postback the focus will jump to the last textbox that had the focus before the postback.
    Even if i blur the textbox by clicking on another (non-textbox) control or anywhere else on the side, if i then trigger a postback, the focus is set to the textbox and the page is scrolled up.

    How did you prevent the controls on your page from stealing focus? Is this expected behaviour?

    Thanks,
    Josef Tiefenbacher 
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 10 Jul 2013 Link to this post

    Hello Josef,

    By default RadAjaxPanel maintains the focus of ajaxified control when the response ends. Therefore, I suggest you try wrapping RadGrid/RadTreeList control in RadAjaxPanel and let me know if this makes any difference.

    Regards,
    Pavlina
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017