I’m trying to get the cell value of an edited cell in a gridview. Can someone help me with my syntax? This code works for the first line in a gridview:
Dim Q As Integer = e.NewValues(e.RowIndex)
but I receive and error if I update line 2… and my variable is ” “:
Index was out of range. Must be non-negative and less than the size of the collection.
This prints the correct row currently being edited:
System.Diagnostics.Debug.Print(e.RowIndex)
I’ve even tried to get the cell value directly:
Dim Qoh As Integer = CInt(gvInventory.Rows(e.RowIndex).Cells(2).Text)
With an error:
Conversion from string "" to type 'Integer' is not valid.
This code worked for my problem:
I assume it is because that is the only editable cell in the grid.