Datagrid: Specified argument was out of the range of valid values

  • Thread starter Thread starter Eashwar
  • Start date Start date
E

Eashwar

Hi:
I don't know if this is a .NET bug. The user enters certain values
and obtains the results from an array list which is bound to a
datagrid. The first time works fine. The second time, when the user
changes a value and then re-executes the code, I get this exception
"Specified argument was out of the range of valid values. Parameter
name: rowIndex". I stepped through my code to see where the problem
is. After refreshing the datagrid, if I type in the command window
?dg, and then execute the code, it does not give me that exception.

the error occurs at this line of code:

Dim strInterest as string =
Ctype(datagrid.Item(datagrid.CurrentRowIndex,2), String)

Any help is welcome. What seems to be the issue here.

Thanks
Eashwar
 
Back
Top