Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > keep selected row in grid view

Reply
Thread Tools

keep selected row in grid view

 
 
Mike
Guest
Posts: n/a
 
      08-10-2007
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?




 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2l2YSBN?=
Guest
Posts: n/a
 
      08-10-2007
Did you try setting GridView.SelectedIndex property after save?

"Mike" wrote:

> 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?
>
>
>
>

 
Reply With Quote
 
 
 
 
lee whitbeck
Guest
Posts: n/a
 
      08-10-2007
On Aug 10, 11:22 am, Siva M <(E-Mail Removed)> wrote:
> Did you try setting GridView.SelectedIndex property after save?
>
> "Mike" wrote:
> > 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?


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"];

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - After submit, want to keep selected row visible Jason ASP .Net 1 12-14-2009 01:49 PM
How to get a particular selected row ID from a grid view ..? Maheshkumar.R ASP .Net 1 08-12-2005 07:15 PM
How to chang bgcolor of row when mouse selected a row? Charles Shao ASP .Net 1 04-18-2005 11:11 AM
How to add a new row to a datagrid with values of the selected row =?Utf-8?B?U3VyZXNo?= ASP .Net 1 11-22-2004 09:04 AM
retrieving text from a selected data grid row cell... Daniel Bass ASP .Net 1 07-08-2003 02:18 PM



Advertisments