private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
DataGridViewRow dgr = dataGridView1.Rows[e.RowIndex];
try
{
if (dgr.Cells["onduty1"].Value.ToString() == "" || dgr.Cells["onduty1"].Value.ToString() == null)
{
dgr.Cells["onduty1"].Style.BackColor = Color.Red;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}