I have multiple listviews on a form (WinForms). List items can be dragged to other listviews. Is there a way to cancel a single item within the dragged items list? The target listview determines whether or not a single item can be dropped there. I'd prefer a solution that will accept all items that are allowed, and reject those that are not. Insights appreciated.
In your drag drop event, move the items that you've "dragged" into a secondary list and cancel the entire dragdrop event.
Watch this list for changes. When you detected changes to this list, pull out any you wish to "cancel". Anything you want to keep add to the new ListView and remove from the old ListView manually. You should be able to find them using Equals as they should be object references though I can't confirm this.
This is just an idea, unfortunately dragdrop doesn't do what you want to do natively and this is the best "workaround" I can think of in 2 minutes.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...