Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

async

$
0
0

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 error

thanks





Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>