Invoke or BeginInvoke cannot be called on a control until the window handle has been created

Let me try to explain what's going on:

I have a group grid bound to a custom data list and I have a separate thread updating the data list. Sometimes I need to rebind the grid to a different instance of the list (same type but different instance). To do this I'm resetting the DataSource of the gird:

grid.DataBindings.Clear();
grid.DataSource = m_SearchedList;

However, as this happens, the user may use "Refresh" menu on my tool bar to refresh the grid. The "Refresh" code is like following:

this.grid.Reinitialize();
this.grid.Refresh();

The problem is that I'll get this "Invoke or BeginInvoke cannot be called on a control until the window handle has been created" once a while. I guess this is because the Reinitialize (or Refresh) methods reconstructs some controls in the grid while other threads are trying to access them.

Any good suggestions on this?

1 Reply

GR Golda Rebecal Syncfusion Team September 11, 2007 02:19 PM UTC

Hi Stanley,

Please refer to the following KB article on how to use GridControl in a multithreaded application:
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=78

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

Loader.
Up arrow icon