PC Review


Reply
Thread Tools Rate Thread

Binding List

 
 
csharpula csharp
Guest
Posts: n/a
 
      27th Nov 2007
Hello,
I have the following situation: A BindingList (which is binding between
list of object and ListBox) of items. I choose few items from the list
-> press a button and want that the items that been choosen will be
transformed to other list and will be delited from the original
ListBox.My problem is that this action also deletes items from the
objects list. How can I juust copy to binding list and see the change in
ListBox only? Thank you!



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      27th Nov 2007
Well, you could call the CopyTo method, copying the items into an array
and then using that to populate a new List<T>, which you would pass to a new
instance of the BindingList<T>, and then bind to that.

However, this will be a shallow copy, so changes you make in one
instance of the object will be seen in the other list. If that's not an
issue, then this should work.

--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"csharpula csharp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
> I have the following situation: A BindingList (which is binding between
> list of object and ListBox) of items. I choose few items from the list
> -> press a button and want that the items that been choosen will be
> transformed to other list and will be delited from the original
> ListBox.My problem is that this action also deletes items from the
> objects list. How can I juust copy to binding list and see the change in
> ListBox only? Thank you!
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding a list to an enumeration... Charlie@CBFC Microsoft C# .NET 2 29th Mar 2007 01:30 PM
DropDown list binding to a datarow Maziar Aflatoun Microsoft C# .NET 1 17th Aug 2005 09:01 PM
binding a dropdown list in web app rbutch@coair.com Microsoft ADO .NET 1 2nd Jan 2005 08:20 PM
Binding List to Control =?Utf-8?B?RmFiaW8gQ2F0dW5kYSBNYXJyZWNv?= Microsoft C# .NET 1 17th Aug 2004 03:28 PM
Binding to a List of Tables Paul Wheeler Microsoft ADO .NET 0 1st Jul 2003 07:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 AM.