My DGV's last visible column in a boolean. I am needing to go through each row and determine if the value of dgv item bFlag is true then turn the row back ground red. Here is my start of it. It appears to be only making one loop then giving the message box. I would appreciate an extra set of eyes on this. Thnx
Code:Private Sub EvalGrid() BindDGV(dgvResults) Dim cnt As Integer = dgvResults.Rows.Count Try For x As Integer = 0 To cnt - 1 'MessageBox.Show(CStr(x) + " of " + CStr(cnt)) Dim item As String '= Number.ToString() item = dgvResults.Item("personid", x).Value If dgvResults.Item("bFlag", x).Value = True Then With dgvResults '.Rows(x).Selected = True .Item("personid", x).Style.BackColor = Color.Red End With End If Next Catch End Try Dim editCnt As Integer = dgvResults.SelectedRows.Count Me.dgvResults.Focus() MessageBox.Show("There are " & editCnt & " records that needs to be corrected") End Sub




Reply With Quote