Hi,
I have a form containing a datagrid where users can enter in their
specified information for each row and column. Behind the scenes I
have a sub which handles datagrid.CurrentCellChanged because I need to
be able to execute some code whenever a user clicks in a different
cell of the datagrid. Inside this sub I place the datagrid.datasource
into a data table so that I can work with it's contents. However, I
am getting "Out of Range" errors sometimes when I try to execute this
code:
Dim index As Integer = dgRentPool.CurrentRowIndex
Dim tbl As DataTable = dgRentPool.DataSource
Dim row As DataRow
row = tbl.Rows(index)
It appears that occasionally even though the datagrid recognizes that
the current row is "1" for example, the number of rows contained in
the datagrid.datasource is only 1 instead of 2.
Does anyone have any ideas on what is causing this error and how I can
resolve it??
Thanks!!
Joy