I've looked at other posts, but I didn't see where I went wrong.
(review attached screenshot for a better understanding)
In my situation, I add background color to row cells where this is an "A" value in the cell. This stands for an aisle in a warehouse.
If you scroll slowly, then the background color stays within the rows with an "A", but if you scroll too fast, the display shows green in various cells. Also, if I clear the grid and rebuild it with new data, the background color is not reset. The previous rows that were green are still green.
What am I missing?
01.Private Sub dgvMain_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles dgvMain.CellFormatting02. If _LeftOrRightConveyor = "LEFT" And e.CellElement.ColumnIndex = AisleColumnLeft_Idx Then03. e.CellElement.BackColor = System.Drawing.Color.LightGreen04. ElseIf _LeftOrRightConveyor = "RIGHT" And e.CellElement.ColumnIndex = AisleColumnRight_Idx Then05. e.CellElement.BackColor = System.Drawing.Color.LightGreen06. End If07. 08. If e.CellElement.Value = "A" Then09. e.CellElement.BackColor = System.Drawing.Color.Lime10. End If11.End Sub