Binding problem

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!
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
C

csharpula csharp

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Binding object 1
PropertyGrid (binding) 1
Binding problem 1
Bind data 3
Data Binding 3
Avoiding WinForm Binding - If Possible... 4
Binding XML Data to WPF 1
Binding List 1

Top