Repositioning grid page and item on reload

2 posts, 0 answers
  1. Rich
    Rich avatar
    25 posts
    Member since:
    Jun 2010

    Posted 04 Apr 2011 Link to this post

    I have a webforms app containing a paged gridview (e.g., 200 records - 50 rows and 4 pages).

    When the user clicks on a button in a specific row of the grid (e.g., row 20 of the 4th page), another web page is launched to process that button click. When the user closes that page to return to the main gridview, the gridview databind event is rerun which redisplays the gridview starting at the item 1 on page 1.

    However, I want to have the previous position maintained, so that the grid will automatically be scrolled to the the previously clicked gridview page and item.

    How would I accomplish this?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Apr 2011 Link to this post

    Hello Rich,

    One suggestion is to set the Grid curreentPageIndex in a Session variable when redirecting. And on pageLoad check for the Session variable and set the currentPageIndex to the value.

Back to Top