I have a databound listbox that is bound to a class call Animal. On another form is several databound listboxes that are different types of animals. All listboxes use the Animal class. So what I want to do is when a user grabs an Animal class from the source listbox and drags it over to the form, depending on Animal.Type, only the listbox named the Animal.Type can accept the drop.
I thought maybe I could do this by using DragEnter. But I can't seem to get the business object out of the data object. I thought if I could, I could check it, and if it matched the Listbox name, I would enable drop. If not, I would disable drop on that listbox. I would do that to all of them.
Is this possible? I have been wrecking my brains and cannot figure out how to get the data out and what property to put it in. All the examples seem to talk about drag/drop strings. I have full blown bound objects.
So it is conditionally dropping depending on a property of the object being dragged.
I thought maybe I could do this by using DragEnter. But I can't seem to get the business object out of the data object. I thought if I could, I could check it, and if it matched the Listbox name, I would enable drop. If not, I would disable drop on that listbox. I would do that to all of them.
Is this possible? I have been wrecking my brains and cannot figure out how to get the data out and what property to put it in. All the examples seem to talk about drag/drop strings. I have full blown bound objects.
So it is conditionally dropping depending on a property of the object being dragged.