I try to get the value of an item on datagrid in edit mode. here the code:
---- The code ----
Private Sub DataGrid_UpdateCommnd (.....)
Dim ExpCode As Integer = CType(e.Item.Cells(0).Text, Integer)
---- The exception ----
Run-time exception thrown : System.InvalidCastException - Cast from string "" to type 'Integer' is not valid.
In a normal mode of the DataGrid I get the value I need from this field with the same code.The exception occur just in edit mode when I try to update the grid in the UpdateCommnd event.