G
Guest
I am emplementing Drag & Drop in a VS2005 C# WinForms application. I have 2
ListView controls on a form, whereby I'm attempting to Drag a ListViewItem
from ListView "A" onto ListView "B."
All the events (ListView_ItemDrag, ListView_DragEnter, ListView_DragDrop,
etc., etc.) seem to be firing correctly.
My goal is to perform a Move from control A to control B. When adding the
ListViewItem to the collection on Control B we receive the following
exception:
"A first chance exception of type 'System.ArgumentException' occurred in
System.Windows.Forms.dll"
I'm taking an existing ListViewItem from control A and moving it to control
B. After a bunch of experimentation I have simply concluded that using an
existing object, for reasons I can't explain, causes the problem. Whereas,
simply adding a new ListViewItem to Control B works perfectly fine.
Checking the documentation, my implementation should work ....
ListView.Items.Add( existing ListViewItem ); This resides in the DropDrop
event handler. The existing ListViewItem is what was sent in the
ListView_ItemDrag event handler, using the DoDragDrop() method .... per the
documentation in VS2005.
Any ideas why this execption is being thrown or what it means???
ListView controls on a form, whereby I'm attempting to Drag a ListViewItem
from ListView "A" onto ListView "B."
All the events (ListView_ItemDrag, ListView_DragEnter, ListView_DragDrop,
etc., etc.) seem to be firing correctly.
My goal is to perform a Move from control A to control B. When adding the
ListViewItem to the collection on Control B we receive the following
exception:
"A first chance exception of type 'System.ArgumentException' occurred in
System.Windows.Forms.dll"
I'm taking an existing ListViewItem from control A and moving it to control
B. After a bunch of experimentation I have simply concluded that using an
existing object, for reasons I can't explain, causes the problem. Whereas,
simply adding a new ListViewItem to Control B works perfectly fine.
Checking the documentation, my implementation should work ....
ListView.Items.Add( existing ListViewItem ); This resides in the DropDrop
event handler. The existing ListViewItem is what was sent in the
ListView_ItemDrag event handler, using the DoDragDrop() method .... per the
documentation in VS2005.
Any ideas why this execption is being thrown or what it means???