Selecting a row in a gridview

  • Thread starter Thread starter katmagic
  • Start date Start date
K

katmagic

I have the SelectedValue of a gridview, how do I select the row based on
that information?
 
I have the SelectedValue of a gridview, how do I select the row based on
that information?

Please clarify a bit more by what you mean by 'select'...

Do you mean you just want to display the row differently, maybe with a
different background colour?

Or do you want to edit the row?

Or do you want to do something else based on the values of one or more of
the row's cells...?
 
Sorry not very clear. I have some controls that are populated based on the
value of the selected row of a gridview. When the user modifies those
controls it causes a postback so I lose the originally selected row of the
gridview. I want to be able to return the user to the row they had
selected, so before the postback occurs, I grab the value of the currently
selected row. Now I want to return the user to that row, how do I do that?
I hope that makes better sense, thank you so much for your help. Something
like gv.SelectedIndex = ???
 
Back
Top