Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi.

After dealing with Gong.Solutions DragDrop, i can't find a way to do the whole Drag and Drop package:

1. Drag and drop between controls of the same app
2. Drag and drop from outside application to those same controls. (windows explorer, i.e.)

My app needs some playlist (listviews) capable of rearrange own items, populate other playlists with those items and finally, accepting a drop file from the windows explorer. I don't need to drag the items outside the app.

I've read somewhere here that using the IDropTarget class would do the trick, but i can't find the way to mix both internal & external dropping because Gong.Solution overrides AllowDrop in XAML.

XML
void IDropTarget.DragOver(IDropInfo dropInfo)
{
    IDataObject dataObject = (dropInfo.Data as IDataObject);
    if (dropInfo.DragInfo != null)
    {
       GongSolutions.Wpf.DragDrop.DragDrop.DefaultDropHandler.DragOver(dropInfo);
    }
    else if (dataObject != null && dataObject.GetDataPresent(DataFormats.FileDrop, true))
    {
       string[] filenames = (string[])dataObject.GetData(DataFormats.FileDrop, true); </pre>



So, the question is: Should i have to move on and discard Gong.Solution easy internal drag drop?

Does anyone knows how to mix both, internal and external drag and drop? Any alternative?

I'm pretty much a newbie in coding, so some example or link could very helpful.

Thank you.
Posted
Updated 18-Jul-15 22:45pm
v3
Comments
Afzaal Ahmad Zeeshan 19-Jul-15 3:21am    
Aren't you a little bit confused about interfaces? That I in the word is to notify that the object is an interface. You should consider using objects that implement this interface.

Also, what API are you using? I am not sure what you wanted to do. .NET framework itself has some great APIs fro Drag-and-drop methods. Read this article for more about that, A Simple Drag And Drop How To Example.
knob2001 19-Jul-15 5:07am    
Hi, Afzaal.

First of all, sorry about whatever mistakes i could do. As i said, i'm still on a very, very early level. The IDrop error was caused because i was using a gong dll too old (when the interface was not implemented yet)

I need to create some lists (populated by 'drag and drop' files from the explorer) and ALSO allow those lists to drag and drop the items between them. Of course, i need to rearrange the items in the lists too.

Dropping items to an App with WPF Visual c# is easy and very well documented. Rearrange and drag and drop items between lists are done via Gong Solutions Drag and drop. The problem begins when i mix both to accomplish the whole solution.

So... any tutorial for that (drag and drop between lists, explorer, and rearrange list)?

Thank you!


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900