Posted on 2012-08-31
I want to do one of two things...
A: Use the select button from Gridview control, populate a text box with the DataKeyName of the selected it. Use the text box to control what appears on four other DetailsView controls.
B: Use two text boxes, either of which may be populated or not, to filter the records in the Gridview control. Use the Select button to select a record. The DataKeyName for that selected item will then control what appears on four other DetailsView controls.
I attempted A and got to this...
Protected Sub GridViewAllSelectedIndexChanged(sender As Object, e As EventArgs) Handles GridViewAll.SelectedIndexChanged
Dim row As GridViewRow = GridViewAll.SelectedRow
Dim strfirst As String = GridViewAll.SelectedRow.Cells(2).Text
Dim strmiddle As String = GridViewAll.SelectedRow.Cells(3).Text
Dim strlast As String = GridViewAll.SelectedRow.Cells(1).Text
txtSelectedPerson.Text = strlast & ", " & strfirst & " " & strmiddle
strItemSelected.Text = GridViewAll.SelectedRow.Cells(0).Text
But nothing happens when I click the Select button in the GridView control.