Problem in Compact Framework with DataGrid
-
I have a problem with setting the datasource property of a datagrid in the compact framework 1.0. Here's the senario: I'm making an asyncronous web service call that returns a dataset with one table. This could be any data in the table. From within the thread for the web service call, I want to get the data and then set the datasource property of the datagrid to ds1.Tables[0];. When reaching that line of code the entire application hangs. I have to stop debugging to return to normal state. Now I at first thought this was a problem with my coding, but the more I delve into it I find that it seems to be a threading problem in the framework. I do not have this problem with any other control, be it a listview, combobox... I can set their display member property while in the other thread with no problem. Now I can change the web service call syncronous and it works fine. The problem seems to center around the thread issue. Has anyone seen this before on a datagrid? Also this problem is inherited by ComponentOne's mobile datagrid since it does the same thing. I have tried converting the dataset to an arraylist and loading it that way... no juice... I have tried creating another dataset at intialization and creating a dumby table with the same charitoristic as the one coming from the web service. set the datasource property of the datagrid to the table, then in the asycronous web service call actually use the dataset.ImportRow in a foreach statement from the dataset the webservice call returns and it will hang on the first record. I guess because the secondary thread is trying to change the datagrid... Any suggestions?