void ResetDgvFilenames(IList <string> filenames) { DgvFilenames.Rows.Clear(); foreach (var file in filenames) { var cell = new DataGridViewTextBoxCell(); cell.Value = file; var row = new DataGridViewRow(); row.Cells.Add(cell); DgvFilenames.Rows.Add(row); } DgvFilenames.ClearSelection(); }
public void OnFileProcessing(string filename) { DgvFilenames.InvokeIfRequired(() => { foreach (var row in DgvFilenames.Rows.Cast <DataGridViewRow>()) { if (filename != row.Cells[0].Value as string) { continue; } row.DefaultCellStyle.BackColor = Color.Gold; DgvFilenames.Refresh(); return; } }); }