ListBox Transfer Sample Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey,

Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.

Thanks
 
Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.

In fact, I'm using a database and dataviewmanager. I've populated an
"available" list box. I've also populated an "assigned" list box.

I would like to create some buttons to transfer (either copy or move) items
to and from the list boxes.

However, I'm not sure how I'm suppose to manipulate the dataviewmanager.

Does anyone have some sample code?
 
Hi,

since I was short on time in my last project, I did an quick and dirty
approach:

ArrayList arItems;

void CreateMyItems()
{
lvi = new listviewitem();
// Do all the needed stuff here

arItems.Add(lvi);

FillMyView(arItems);
}


So each form had the FillMyView(ArrayList al) func and it works great.
The only trouble is if you need to modify the items on one form but keep
the old data in the other form. I'm not sure, but there was some issue
about one of those "passing my items"-thing.

Hope this helps,

Martin
 
Back
Top