I have a DataGridView which is bound to a DataSet. I have a CheckBox Column. When I want the row to change color as soon as user checks a particular row. I am able to change the color with my code but for some reason unknown to me.. the color gets changed only when I leave the cell.
Private Sub DataGridView1_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
If DataGridView1.Columns(e.ColumnIndex).Name = "ColCheck" Then
If DataGridView1.Rows(e.RowIndex).Cells("ColCheck").Value = True Then
DataGridView1.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.LightGreen
''' blah blah blah...
No comments:
Post a Comment