[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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