Threading, datagrid and asynchronous events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Windows form app which receives data asynchronously thru an
external app. The events are handled by some event handler code which locks
the dataset table that the data is being placed in while the event is being
handled. The table being updated is bound to a datagrid. The app crashes
after a random amount of time. The error is only trapped at the application
level and seems to have sometime to do with the datagrid. When I remove the
binding to the datagrid no crash occurs. Can someone provide an explanation
and/or point me towards a design or reference for handling this situation?
 
Hi there... I'd suggest you to have a temporary table (with a structure
similar to the one bound to the datagrid). Receive the data in the
temporary. Have a timer in your form, when the timer's tick event is fired
copy the information from the temporary to the working table (bound to the
datagrid). It's an easy way to get what you want. Hope this may help you.

Regards,
 
Back
Top