Most of the developers prefer placing contents in an Update Panel so that they can avoid full page postback. But, when we place Gridview for Wijmo in an Update Panel then it loses its scroll position after the asynchronous postback as the grid is reloaded. The scrollbars are reset and the end user is required to scroll it back to the location where it was before partial postback. This blog will help you maintain the scroll position of the Wijmo Gridview placed inside an Update Panel on asynchronous postback. To begin with, we need a Gridview bound to a datatable. Place an UpdatePanel & ScriptManager on the webpage and then, refer to the documentation for binding Gridview with datatable. After doing so, you can attach the click event of the button to the UpdatePanel in order to cause the partial postback. Execute the implementation till now and scroll the grid to view the hidden rows. Now, if you click on the button, you will observe the grid is re-rendered due to asynchronous postback and scrollbars lose their scroll position. The approach used to prevent this behavior is based on the fact that internally, Wijmo Gridview consists of Wijmo Superpanel. So, we can access the horizontal/vertical scrollbars of this superpanel, store the S**crollBar values and when the grid is redrawn, we set this scroll values to the scrollbars. In order to get/set the scroll value, we need to handle beginRequest and endRequest events of PageRequestManager** class which manages partial-page updates of UpdatePanel. Here is the code which will do the job for you:
Make sure that you place the script after the ScriptManager on your page. You may also download the complete sample.