Multi-thread and datagrid

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

I tried to use thread to load data to datagrid but it gived me errors?
Anyone know how to solve it?
 
news.microsoft.com said:
I tried to use thread to load data to datagrid but it gived me errors?
Anyone know how to solve it?

Windows Forms controls' instance members are not safe for multithreading,
which means that you cannot access them directly from another thread. Make
sure you are using 'Control.Invoke'/'Control.BeginInvoke' together with
'Control.InvokeRequired' to access the datagrid from the thread. Some more
information about Windows Forms and multithreading can be found here:

Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DataGrid Cross Thread Access 2
Threads Question - updating UI 2
Can be done? 1
Proper way to bind data from sqlserver to datagrid 1
Thread issue ?? 3
Using DataGrid to data input 1
Datagrid 7
Thread Results 1

Back
Top