Gridview sorting - MaintainScrollPositionOnPostback = true does not work

386 Views Asked by At

I have a gridview on a web page. I wanted to maintain the scroll position everytime it postbacks after sorting gridview. I have included MaintainScrollPositionOnPostback attribute in the page directive, also included below in Page_load

Page.MaintainScrollPositionOnPostback = true 

But it does not work.After post back it always goes to the top of the page. Am I missing anything?

1

There are 1 best solutions below

0
On

One solution would be to use your gridview inside update panel as mentioned here-

Maintain horizontal and vertical ScrollPosition on Postback in ASP.NET