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
205
UltraDataSource and Multithreading
posted

Hello!

Iam looking for some advice in matter of multithreaded operations on UltraDataSource (IG7.1.20071.40). As I was writing in my some other post Iam constructing Explorer like test-app with IG. I have UltraDataSource binded to the UltraGrid. Already stumbled on the "red cross error" and Iam aware that modyfing data on external thread is reason of it. Ive read probably everyting on threading and IG avalible on forums, but still can't apply my knowledge against UltraDataSource component.

App works like this (1 thread only):
(1) UltraGrid binded with UltraSource with basic Band
(2) App start. App lists C: dir
(3) If app founds not empty dir it creates an empty childband for it with a "dummy-row" so the [+] would appear.
(4) If user clicks on [+] which was placed for the "dummy" row, app responds on it in "BeforeExpand" event
(5) App fetches the subdirstructure and applies it to the childband (removing dummy-row first), and then expands and show structure...

While its only on one thread it "frozes" while fetching structure of large dir. I wanted to put step (5) in another thread and "update live" the expanded node view. But is it even possible with UltraDataSource ?

Ive found the UI Thread Marshaling in the Model Layer article, but example presented there applies to CutomDataSet which inherits from DataSet class, and it "binds" together in this point of code: this.Tables.Add(MainTable)

Ive tried to implement it for UltraDataSource but failed miserably. Is above example event applies to the Model-Views solution ? Please help