I have a DataGrid in VB.Net 2003 which is bound to a DataSet. The last column in the DataSet is a boolean column and gets represented as a checkbox column in the bound DataGrid. Now I have a function the loops through each row of the DataGrid and checks the status of the boolean column (if it is checked or not). Everytime the user checks this column on any row (by clicking on it), I call this function. The problem is that the function correctly reads the state of the boolean column of each row except for the row the user just checked. This row it sees as unchecked until the user moves to another row (either by clicking on another row or by using the arrow keys). And the same happens if the row was already checked and the user unchecks it - when I loop through the rows all the rows will read correclt except for this recently unchecked row which still shows up as checked until the user moves to another row.
Here is the code. As you can see I've tried both reading the boolean column (column 7) directly on the DataGrid, as well as from its associated DataSet:
For i As Integer = 0 To DataSet1.Tables(0).Rows.Count -1
But both work perfectly for all rows but the one that was just checked/unchecked. Any ideas how I can fix this?