locked
Scroll position of a gridview inside div tab. RRS feed

  • Question

  • Hi All,

    I am facing issues with retaining the scroll position in a div tag. I have a gridview inside a div tag (I have a set a certain height for the tag and also overflow is set to scroll). In the gridview, i have a asp:TemplateField which is a dropdownlist. Based on the user selection from the dropdown, postback happens and some calculation is happening. See the pic below, "Weighted Score" is the calculated field. There are many rows on the grid. When i scroll down and enter data, postback happens (for the dropdown selection) and it takes back to the top of the page.

    I have set MaintainScrollPositionOnPostback to"true", but it does not work inside a div. If there was no div, with MaintainScrollPositionOnPostback, the scroll position is not changed to top of the screen.

    I have also tried few javascripts to set the scroll position of the div and they are not working either. Can anybody help please?

    Please note - I am using master and content page setup. The grid is on the content page.

    • Moved by CoolDadTx Friday, June 12, 2020 1:16 PM ASP.NET related
    Friday, June 12, 2020 12:02 PM

All replies

  • This forum is strictly for C#, use the ASP.NET forums for your question

    https://forums.asp.net/


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, June 12, 2020 1:08 PM