How would I hide all rows on my dataGridView that do not match the date of "27/11/2013". Currently the code below hides all my rows...
private void viewOverdue_Click(object sender, EventArgs e)
{
CurrencyManager manager = (CurrencyManager)BindingContext[dataGridView1.DataSource];
manager.SuspendBinding();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (!string.Equals(row.Cells[0].Value.ToString(), "27/11/2013", StringComparison.OrdinalIgnoreCase))
{
row.Visible = false;
}
else
{
row.Visible = true;
}
}
manager.ResumeBinding();
}