Master Detail page problem

J

Jon Paal

using VWD, Master/detail example page is not working correctly. Selected row from gridview does not display in the detailsview.
Detailsview always shows the same record, and never changes, regardless of gridview selection.

How do I pass the SelectedDataKey.Value from the gridview to detailsview in VWD ?

The selected value from the gridview is correct when displayed by the response.write statement in the code below. The detailsview
is using the primary key value as the DatakeyNames and I have the following code in the script:

Code:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
DetailsView1.PageIndex = GridView1.SelectedDataKey.Value
Response.Write("<b>SelectedDataKey.Value: </b>" & Server.HtmlEncode(GridView1.SelectedDataKey.Value) & "<br />")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top