Home > Net >  When the child thread updated in Datagridview cannot real-time refresh
When the child thread updated in Datagridview cannot real-time refresh

Time:09-16

With DataTable binding the Datagridview, listen to a message sender in the thread, when messages are received, check whether the existing in the DataTable corresponding line, if yes, update a few fields, if not, add new lines, the above operations in a thread, now find when update field, binding the Datagridview corresponding field can real-time refresh, add new rows, not real-time refresh, must click somewhere in the picture, or drag the scroll bar, to make the new row displayed, could you tell me how to solve this problem?

Supplement: don't want to take the initiative to call Datagridview. Refresh (), even call Datagridview. Refresh (), the vertical scroll bar also showed abnormal

CodePudding user response:

Can not add line binding

CodePudding user response:

The data source first=null;
Data source again=DataTable;

CodePudding user response:

This has nothing to do with multithreading, multithreading, across threads of control, use the BeginInvoke,
Scroll to the new row, is for you to write code,
  •  Tags:  
  • C#
  • Related