Hey,
Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.
Thanks
Sivana - 31 Jul 2005 21:56 GMT
> 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?
Martin Peter Hanke - 31 Jul 2005 22:00 GMT
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
> Hey,
>
> Does anyone have any sample code where I can transfer list items between two
> list boxes. C# and WinForms.
>
> Thanks