Changing Selected Record Programatically ASP.NET

I have a gridview and a formview that I'm using.   I want to be able to have someone select a value from the gridview and have that be the selected record in the formview, but I want them to still be able to iterate through the other records in the formview - I just want the value from the gridview to be the current record.

How do I cause the formview to go to the selected record without completely filtering out the other records?

Thanks.
pemberley1210Asked:
Who is Participating?
 
zwiebeleCommented:
Try this:

protected void GridView_SelectedIndexChanged(object sender, EventArgs e)
{
      FormView.PageIndex = GridView.SelectedRow.DataItemIndex;
}
0
 
pemberley1210Author Commented:
Perfect!!! Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.