C# mover

  • Thread starter Thread starter Andy Summers
  • Start date Start date
A

Andy Summers

Hi,

Does somebody have an example C# code of how to move items between two
lisbboxes? Or maybe a ready to go component. I found an ASP example, but is
there something for Windows forms project?

Thanks,
Andy
 
Andy,

Do you need something that is drag and drop, or you just want to click a
button and move items selected in one to another?
 
I believe the fastest way will be to move data source. If you have
datasource. If not, probably it will be easier to create one and then you
can switch listboxes in couple of = operators.

HTH
Alex
 
The one with the buttons will do.

Thanks,
Andy

Nicholas Paldino said:
Andy,

Do you need something that is drag and drop, or you just want to click
a button and move items selected in one to another?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andy Summers said:
Hi,

Does somebody have an example C# code of how to move items between two
lisbboxes? Or maybe a ready to go component. I found an ASP example, but
is there something for Windows forms project?

Thanks,
Andy
 
Andy,

I'm assuming you are manually populating the Items collection? If so,
you should be able to remove the items from the collection using the Remove
method, and Add them to the other collection using the Add method.

If these are data-bound lists, then you will have to work with the
underlying data source, depending on what it is, and if it supports updating
the list itself.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andy Summers said:
The one with the buttons will do.

Thanks,
Andy

Nicholas Paldino said:
Andy,

Do you need something that is drag and drop, or you just want to click
a button and move items selected in one to another?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andy Summers said:
Hi,

Does somebody have an example C# code of how to move items between two
lisbboxes? Or maybe a ready to go component. I found an ASP example, but
is there something for Windows forms project?

Thanks,
Andy
 
AlexS said:
I believe the fastest way will be to move data source. If you have
datasource. If not, probably it will be easier to create one and then you
can switch listboxes in couple of = operators.

I think the requirement is to move individual items, not swap the whole
lists.
 
there some good examples

in the help

we go it to work easy as

steve
 

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

Back
Top