We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to used WinForms GridControl in a multithreaded application?

Platform: WinForms |
Control: GridControl
Tags: threading

GridControl in multithreaded application

Like the most Windows Forms controls, the GridControl can be used in multithreaded applications as long as you use the Invoke/InvokeRequired techniques to make sure that all the interactions with the Grid is done on the thread that created it.

The requirement for using multiple threads is that every UI control must interact with the UI thread that created it. The simple way to do this is to use InvokeRequired to test whether you are on the wrong thread.

So, anytime you access the Grid from within a method that may have been called from the non-UI thread, you must use the grid.InvokeRequired to test whether this call is coming on the UI thread. If not, then you must call grid.Invoke on a new delegate to force the call to be on the UI thread.

There is a couple of articles on MSDN online by Chris Sells that discusses this problem. Here is a link to an article by Ian Griffiths that discusses these problems and also provides links to the Sells articles.

You can refer to the attached sample that illustrates how to use these ideas with the Grid.


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile