The original: Resolves an issue where DataGridView cannot display scrollbars in multiple threads
DataGridView specified DataSource to populate the data in multi-threading, when updating data, can cause DataGridView to appear suspended animation, display errors or scroll bar can not display the problem, In cases where the scrollbars setting of the DataGridView is guaranteed to both, the amount of data is greater than the range shown by the DataGridView, and there is no frozen column, the workaround is as follows:
One is to use Invoke to return the code that executes the data binding back to the main thread (because DataGridView is created by the main thread);
The second is to set the DataSource to null before specifying it.
Private Delegate void Invokehandler (); // in a child thread this. Invoke (new Invokehandler (delegate() { null; Datagridview1.datasource = Dgv_dt; }));
Ignores the object created by the main thread of the sub-threading operation Just add one sentence: Control.checkforillegalcrossthreadcalls = false, but not in multi-threading.
Fix an issue where DataGridView cannot display scroll bars in multiple threads