I had a hard time finding any information at all about dragging and dropping between controls of different types contained in separate user controls. I am talking about dragging from an Infragistics UltraGrid in a user control to an Infragistics UltraWinTree
in another user control, for example. Probably a common scenario, and I bet a lot of people go trough the same trouble, so maybe this can help.
The magic happens in a few steps:
First you need to set the AllowDrop property to true on both controls.
Next you need to catch the SelectionDrag event. It will fire when you start dragging from the grid. ON that handler you need to call the DoDragDrop method. That will start the process and change your cursor for you, based on the DFragDropEffect you use on the
method call. I used DragDropEffect.Move, and that changes the cursor to a little plus sign inside a box.
Now we are waiting for the user to move the mouse over the tree. We will capture that on the DragEnter event of the tree, check to see if what is being dragged is what we want and set e.Effect to DragDropEffects.Copy if we want to allow the drop or to DragDropEffects.None
if we don't want to allow the drop.