public void HighlightCheckedRows(UserDataGridView dg) { if (dg.Rows.Count == 0) { return; } foreach (DataGridViewRow row in dg.Rows) { if (row.Cells[1].Value == null) { continue; } if ((bool)row.Cells[0].EditedFormattedValue) { row.DefaultCellStyle.BackColor = Color.LightGreen; } else { string filepath = IncomingDir + row.Cells[1].Value.ToString(); if (CONSTS.FilesExceptions.Contains(filepath)) { row.DefaultCellStyle.BackColor = Color.IndianRed; } else { row.DefaultCellStyle.BackColor = Color.White; } } } }
public void HighLightExceptions(UserDataGridView dg) { string selectedFile = ""; foreach (DataGridViewRow row in dg.Rows) { selectedFile = IncomingDir + row.Cells[1].Value.ToString(); if (CONSTS.FilesExceptions.Contains(selectedFile)) { row.DefaultCellStyle.BackColor = Color.IndianRed; } } }