Home All Groups Group Topic Archive Search About
Author
29 Nov 2007 9:11 AM
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!



*** Sent via Developersdex http://www.developersdex.com ***

Author
29 Nov 2007 12:38 PM
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.


--
          - Nicholas Paldino [.NET/C# MVP]
          - mvp@spam.guard.caspershouse.com

Show quote
"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 ***
Author
29 Nov 2007 4:08 PM
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!


*** Sent via Developersdex http://www.developersdex.com ***

AddThis Social Bookmark Button