Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

DataSource Property and Thread Safety

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pearsons_11114 - 23 Apr 2005 04:46 GMT
What happens if the object referenced by the DataSource property in a ListBox
is updated by another thread? Is ListBox smart enough to check InvokeRequired
before updating the GUI based on the change? IList doesn't publish any
events, so it's not clear how the changes to the IList are being detected
under the covers.
Andrew Smith \(Infragistics\) - 23 Apr 2005 16:52 GMT
Even if the listbox wanted to make that check, it wouldn't matter because
the bindingmanager is not threadsafe. As documented in the ms docs, the
bindingmanagerbase class' instance methods are not thread safe. Basically,
you should not manipulate the underlying datasource from any thread but the
ui thread. The other option is to manipulate a different object that will
serve as a datasource and when you are done manipulating that, marshall a
call to the ui thread and then set the databound objects to use the new
object as its datasource.

> What happens if the object referenced by the DataSource property in a
> ListBox
[quoted text clipped - 3 lines]
> events, so it's not clear how the changes to the IList are being detected
> under the covers.
pearsons_11114 - 23 Apr 2005 17:21 GMT
I was afraid of that. Thanks for the doc pointer as well.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.