Below code is not working.not changing color.. data type is datetime..
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{if (e.ColumnIndex == 6)
{
var mydatetime = DateTime.Parse(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
if (mydatetime.Hour > 9 && mydatetime.Minute > 30)
{
e.CellStyle.BackColor = Color.Yellow;
}
}
}
Midhun TpPosted Aug 22, 2017, 1:15 AM
Mohammad ImranPosted Aug 23, 2017, 3:33 AM
Midhun TpPosted Aug 22, 2017, 4:05 AM
Mohammad ImranPosted Aug 22, 2017, 1:50 AM
Manas MohapatraPosted Aug 22, 2017, 1:04 AM
Mohammad ImranPosted Aug 22, 2017, 12:58 AM
Manas MohapatraPosted Aug 22, 2017, 12:54 AM