0

How to compare dates in one DataGridView column. I use for loop to do this, but no luck.

for (int i = 0; i < dgv.Rows.Count; i++)
{
    DateTime currDate = Convert.ToDateTime(dgv.Rows[i].Cells["End Date"].Value);

    //index[0] > index[1] 
    //2020-04-04  2020-04-10
    if (currDate > currDate)
    {
        MessageBox.Show("In Progress");
    }
}
Salah Akbari
  • 39,330
  • 10
  • 79
  • 109
paulrndp
  • 1
  • 1

0 Answers0