I have a DataGridView and implemented the RowPrePaint event like this:
DataGridView
RowPrePaint
private void dgData_RowPrePaint(object sender, DataGridViewRowPre