Protected Sub LinkButton1_Click(sender As Object, e As EventArgs)
Dim btnsubmit As LinkButton = TryCast(sender, LinkButton)
Dim gRow As GridViewRow = DirectCast(btnsubmit.NamingContainer, GridViewRow)
lblbarcode.Text = GridView1.DataKeys(gRow.RowIndex).Value.ToString()
lblbarcode.Text = gRow.Cells(0).Text
txtbarcodetext.Text = gRow.Cells(1).Text
txtproductcode.Text = gRow.Cells(2).Text
txtlocation.Text = gRow.Cells(4).Text
If Not IsDBNull(Convert.ToString(gRow.Cells(3))) Or Not IsDBNull(gRow.Cells(3).Text) Then
DropDownList2.SelectedIndex = -1
Me.ModalPopupExtender1.Show()
Else
DropDownList2.Text = gRow.Cells(3).Text
Me.ModalPopupExtender1.Show()
End If
End Sub