There is software for highlighting when the date has expired, the problem is that when you run the software, the lines in the dataGridView are visually floating. How to fix?
The code below, if you remove it, the lines are displayed correctly.
private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { if (e.RowIndex < 0 || dataGridView1.Rows[e.RowIndex].IsNewRow) return; var dt = DateTime.Now; dt = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0); if (((DateTime)dataGridView1.Rows[e.RowIndex].Cells["Срок до"].Value).CompareTo(dt) < 0) dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red; It is white, but if you scroll the mouse wheel, it paints a second on red in red and immediately becomes white again.


dataGridView1.Rows[e.RowIndex].Cells["Срок до"].Valueseems to be a string - Grundy