Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7785623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:17:08+00:00 2026-06-01T20:17:08+00:00

I have a RadGrid inside a div set to overflow auto. If you scroll

  • 0

I have a RadGrid inside a div set to overflow auto. If you scroll down and select a row the div’s scroll position gets reset to the top. Tried using built-in scroll functionality but this didn’t work (layout breaks and only background of template cells scroll without scrolling other elements). Tried JavaScript to reset scrollTop property of div on active row changed but this also didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:17:08+00:00Added an answer on June 1, 2026 at 8:17 pm

    Found my own solution to this one. I created two hidden fields – one that maintains the scroll position (ScrollPosition), and another that maintains the ID of the scrolling container div (ScrollingContainerID). My RadGrid is embedded in a User Control, so I have a server-side method to set the div the grid is contained in:

    public void RetainContainerScroll(HtmlGenericControl container)
    {
        if (container.IsNotNull())
           ScrollingContainerID.Value = container.ClientID;
    }
    

    On the RadGrid, I set two client events:

    <ClientEvents OnRowSelecting="RetainScrollPosition" OnRowClick="RestoreScrollPosition" />
    

    Then I defined the following client-side functions:

    function RetainScrollPosition(sender, eventArgs) {
       var container = GetScrollingContainer();
       if (container == null)
          return;
       SetRetainedScrollPosition(container.scrollTop);
    }
    
    function RestoreScrollPosition(sender, eventArgs) {
       var container = GetScrollingContainer();
       if (container == null)
          return;
       container.scrollTop = GetRetainedScrollPosition();
    }
    
    function GetScrollingContainer() {
       var scrollingContainerField = document.getElementById("<%= ScrollingContainerID.ClientID %>");
       if (scrollingContainerField == null)
          return null;
       var containerID = scrollingContainerField.value;
       if (containerID == null || containerID.length == 0)
          return null;
       var container = document.getElementById(containerID);
       return container;
    }
    
    function GetRetainedScrollPosition() {
       var scrollPositionField = document.getElementById("<%= ScrollPosition.ClientID %>");
       if (scrollPositionField == null)
          return 0;
       return scrollPositionField.value;
    }
    
    function SetRetainedScrollPosition(scrollPosition) {
       var scrollPositionField = document.getElementById("<%= ScrollPosition.ClientID %>");
       if (scrollPositionField == null)
          return;
       scrollPositionField.value = scrollPosition;                        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RadGrid set up to use the NeedDataSource event. I also have
I have a question about Telerik. I have a RadGrid where inside the MasterTableView
I have a RadGrid with a datatable as it's source. I have AllowCustomPaging set
G'day, I have a RadComboBox control inside of a RadGrid that is displayed when
I have a RadGrid in a RadWindow set to Modal. I'm seeing two issues.
I am using Jquery dialog to show radgrid. I have set AllowFilteringByColumn to true
I have a Radtreeview that sits inside a RadGrid. For some reason the expand/collapse
I have a RadGrid bound to a LinqDataSource. The grid has auto generated Edit
I have a RadGrid, with the EditFormSettings set to Template. Within my <FormTemplate> I
I have a Telerik RadGrid with a GridTemplateColumn that contains a checkbox, as follows:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.