|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Binding problemHello,I use the following data binding: controlA.DataSource = someList;.
The someList content changes due to some other form object behaivior and controlA still presents not updated data.Why? Isn't DataSource provides binding that holding a reference to the binded list? How can I solve this? Thank you! *** Sent via Developersdex http://www.developersdex.com *** A regular list has no way of notifying what it is bound to that it has
changed. You will have to implement IBindingList, which will give the list a mechanism to know when items changed in the list. You can also use BindingList<T>, which implements IBindingList, but you will have to work with that everywhere, as it makes a copy of the collection you pass to it, it doesn't hold a reference to the original. -- Show quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "csharpula csharp" <csharp***@yahoo.com> wrote in message news:ulxmIfmMIHA.3400@TK2MSFTNGP03.phx.gbl... > Hello,I use the following data binding: controlA.DataSource = someList;. > The someList content changes due to some other form object behaivior and > controlA still presents not updated data.Why? Isn't DataSource provides > binding that holding a reference to the binded list? How can I solve > this? Thank you! > > > > *** Sent via Developersdex http://www.developersdex.com *** In my case I tried to do such thing with BindingList<obj> :
ListBox1.DataSource = nBindingList; //nBindingList is of type BindingList<obj> . But still a change that occure at binding list is not being seen at ListBox. Why ? Thank you! *** Sent via Developersdex http://www.developersdex.com *** |
|||||||||||||||||||||||