Hi all,
I'm trying to clean a datagridview on what is written in a SEARCH (textBox). It's works on column COD.
I would like to do ASYNC, since I have 2000 rows, but I can't.
tips?
For example:
COD
124
12345
12355
1532
1629
1895
when I write "12" only the first 3 must remain
When I write "123" only the second and third must remain
But if I cancel and stay "12", only the first three have to return.
I tried This
Task.Factory.StartNew(() =>
{
foreach (DataGridViewRow row in dgvProduct.Rows)
{
dgvProduct.Rows[row.Index].Visible = true;
if (row.Cells["Cod"].Tag.ToString().StartsWith(s, true, CultureInfo.InvariantCulture))
{
//
}
else
{
dgvProduct.Rows[row.Index].Visible = false;
}
}
});
but cross thread errorthanks