I have a gridview in webform and a panel1 which I used as a modalp开发者_高级运维opup control. I wanna show panel as modalpopup per row item select using commandrow of gridview ...
There are two controls inside panel1; literal1 and literal2
I want when the item in the gridview is selected by user then panel 1 shows as modalpopup which displays the records from gridview in panel 1 controls i.e literal1 , literal2
I want to retrieve the selected row item from gridview to modal popup panel1 control..
This may be more than you need but it should help you identify the row that's been selected in your GridView and allow you to display the coresponding data in your modalpopup. It's simply called by an ImageButton (or whatever control you want) on each row of the GridView with "OnClick=Show_Detail". Hope it helps.
Private Sub Show_Detail(ByVal sender As Object, ByVal e As EventArgs)
Dim lbValue = CType(sender, ImageButton)
Dim myValue As Integer
Dim myDataKeyID As Integer
myGridView.SelectedIndex = CType(lbValue.Parent.Parent, GridViewRow).RowIndex
myDataKeyID = myGridView.SelectedDataKey.Value
myValue = lbValue.CommandArgument
End Sub
精彩评论