• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

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.
0
pemberley1210
Asked:
pemberley1210
1 Solution
 
zwiebeleCommented:
Try this:

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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now