Change the color of a row in datagrid when certain column is not blank
I have the following code that 's giving me the following error when I run it. I attached a screen print of the errror.
As you can see in the screen print it says: Column Named Vacation_On cannot be found.
Which doesn't make sense, because the column exists in my Access database and I can see it in the datagridview.
Any ideas what's causing the error??
For Each row As DataGridViewRow In Me.DataGridView1.Rows If row.Cells("Vacation_On").Value Is DBNull.Value Then row.DefaultCellStyle.BackColor = Color.White Else row.DefaultCellStyle.BackColor = Color.Aqua End If Next
Open in new window