This is a migrated thread and some comments may be shown as answers.

Repositioning grid page and item on reload

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 05 Apr 2011, 12:41 AM
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?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Apr 2011, 06:09 AM
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.

Thanks,
Shinu.
Tags
Grid
Asked by
Rich
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or