Binding problem

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

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!
 
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.
 
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!
 
Back
Top