jeudi 2 avril 2015

Asynchronously paint datagridview

I need to paint a datagridview on a main thread. The data I'm processing comes from big excel files that often contain thousands of records. When I validate (check for errors and paint), it blocks the main UI, displays "application is not responding" and doesnt refresh the progress bar untill its finished.


I dont have such problem when using background worker, but since its necessary to paint datagrid && add listview items on the main thread this approach won't work.


I'm ok with it running on main thread, but I want it to show the progress bar and not become unresponsive.


I'm fairly new to asynchronous programming and Control.Invoke(). How should I handle this?


Aucun commentaire:

Enregistrer un commentaire