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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top