I have the following code...
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.RowUpdating
Dim SocioNumInfo As Integer = CInt(GridView1.Rows(GridView1.SelectedIndex).Cells(4).Text)
MsgBox(SocioNumInfo.ToString)
...
End Sub
Now, this code should read the cell, but it gives me the following error:
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
The MsgBox is just there for me to check if the data is being read, at the end of the day it should turn that into a parameter so I can add to the DB... but still.. nope nothing. Is that the correct code to read directly from a cell in a choosen row? In the "Protected Sub" area I already tried SelectedIndexChanging and RowEditing, etc... and still nothing. Still throws the error at me.
If I try
Dim SocioNumInfo As String = CStr(GridView1.Rows(GridView1.SelectedRow).Cells(4).Text)
it gives me a "cannot be converted to Integer" error.