Houssam

Houssam

  • NA
  • 24
  • 26.6k

[Solved] RowsAdded Event made a Strange behavior when changing back color of row in DataGridView

Nov 23 2012 8:35 AM
Hi ..
I bind a DataGridView to a (List<Payment>) collection, I am using RowsAdded Event to Change the back color of the row depending on the status of the payment.
I am using (row.DefaultCellStyle.BackColor) to change the back color, But If I changed the color of the First row, then the color of the second row will be changed also, even though I did NOT change its back color.
and I don't want to change its back color to (white) because there are some columns that have their own colors.

how to solve this ?

the source code is attached.
thanks in advanced


Attachment: rowsaddedproblem.zip

Answers (3)