Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
ultragrid and a background worker
posted

im using a background worker to fill a dataset from a sql query and setting the datasource of the ultragrid to that dataset. i sometimes get an object not set to an instance error while doing this and i think it must do with setting the grid datasource. i saw the help here : http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=9838

 but i am not using a collection as in the example. im not sure if i should be setting the datasource on the background thread or if i should fill the dataset on the background worker, and use the UI thread to bind the grid to the dataset. any help i would really appreciate. thanks

Parents
  • 469350
    Verified Answer
    Offline posted

    Using threads like this can be very dangerous. If the grid is bound to the data source and your code causes the data source to raise a notification which will pass over to the UI Thread without being properly marshalled.

    The safest thing to do would be not to bind the grid to the data source until after the worker thread has completed and the data has been properly marhsalled to the UI Thread.

Reply Children