I have an issue with maintaining scroll position.
I am almost positive that I have everything set correctly. I have updated my web config…
<pages maintainScrollPositionOnPostBack="true"
and everything seems to work fine UNTIL….
When ever my Gridview returns a lot of pages, like more than 50, sometimes upwards of 100 or more, I show 50 records per page. The farther into the Gridview, the more the scroll position is off.
So what I am saying is that for the first 20 plus pages or so, if I scroll down the page to the point where the top rows have moved off the screen and I enter Edit Mode, the correct record remains in view on Postback.
But if I am over say around 30 pages into the Gridview, the further in the worse it gets, when i enter Edit Mode I have to scroll back down to the location of the record that I selected to edit.
Any ideas on this one will be tested, my users are going nutts!!!
thanks again,
You could wrap the gridview in a div set with overflow:auto. Then with js reset the scroll position when the page loads. something like this.
Visual studio will probably give you warnings that onscroll isn’t valid but it has always worked for me. If your using an update panel it’s a little more complicated. Actually all of mine are in update panels so I tried to revert this code back, so hopefully this will work for you.