简体   繁体   中英

How to display data into datagridview using multi thread?

I have application where I read/receive data all the time (text) and I need to display this data into datagridview, what is the best way to do that in real time, so the data will be changed all the time.

I thought about multi threading, if this is a good idea can you guide me with link to explain how to implement it.

Thanks

You can use a BackgroundWorker to execute a thread in the background to receive data. Then you need to use Control.Invoke to marshall calls to the UI thread to update data.

This link provides some example code you can use as a starting point.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM