keep selected row in grid view

M

Mike

On my web form I have a gridview and I allow the user to edit a row but clicking a button above the grid. The Edit button takes them to a edit page with the details of the selected row. When they click 'save' on the Edit page it takes them back to the page.


How can I have the row they selected to edited remain selected when they come back from the edit page?
 
L

lee whitbeck

Did you try setting GridView.SelectedIndex property after save?

You will have to store the selected index, so that when they click
save, and go back to the page you can reset the Index Value. You can
use a session like below.

GridView1.SelectedIndex = (Int32)Session["SelectedGridIndex"];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top