I have a table an some values on it. If the Row Cell "Name" is not empty change color of background to violet.
Name ID Customers
Niky 1 yes // here change background to violet
2 no
Donna 3 yes // here change background to violet
Baka 4 no // here change background to violet
5 yes
6 no
I have tried this code but i doesnt work, dont know why:
foreach (DataGridViewRow row1 in dataGridView1.Rows)
{
if (row1.Cells[0].Value != null)
{
row1.DefaultCellStyle.BackColor = Color.Violet;
}
}