datasourcing a formview to a gridview

ARC

Well-known member
Joined
Sep 9, 2006
Messages
63
Location
Minnesota
Programming Experience
Beginner
Im having problems getting the Formview to display the correct field that the user selects from the Gridview... Am I missing something obvious?



This is in the Code Behind (default1.aspx.vb)
VB.NET:
Expand Collapse Copy
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        FormView1.PageIndex = GridView1.SelectedIndex

    End Sub

Ok, to be more specific, the code above works sort of. It changes fields, but not to the correct fields. If the gridview is on Page 2 and the user selects the first field on that page, the formview displays the very first field in the database.

example; if the gridview is set to show 5 fields at once, and paging and selection is enabled... and the user moves to page2 to view records ID_6 through ID_10 and selects the first field, the Formview then displays the first field of the first page (ID_1). Do ya get it?

::EDIT::
I've tried exploring the intellisense options to see if maybe the Formview doesnt work the same as a DetailView with the PageIndex method, but from what im seeing in other posts here online it's supposed to work fine with it, and nothing else seems to apply. Hmmm...
 
Back
Top