I have a template column in a asp.net web form that has a link button in it. when I click on the link button I want to read the value from the third column for the current row. The following code works fine in a command column of the grid but not from the template column:
Dim x As String = Me.GridView1.Rows(Me.GridView1.SelectedRow.RowIndex).Cells(3).Text
If I use this in the template column it returns an error.
What am I doing wrong?