This is a migrated thread and some comments may be shown as answers.

Drag'n Drop in a RadWindow

2 Answers 73 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 24 Nov 2010, 10:50 AM
Hello,

In my Silverlight 4 app, i have an user control which contains a ListBox.
I have implemented the Drag'n Drop on it. So, when i drag and drop a local file, it will upload it and  display it in my ListBox.
The system works very well if i load my user control in a Silverlight Page.

But sometime, i load this user control in a ChildWindow (from SL Toolkit) and it seems that the Drag'n Drop system doesn't work.
In fact, when i drop my file in my ListBox (in the ChildWindow), Internet Explorer opens and display my file (for ex, a JPG file) and so skip the silverlight app.

In another thread on this forum, i read you said to use the RadWindow and add :
this.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDropInfo), true);
 
this.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDragInfo), true);
 
this.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDragQuery), true);
 
this.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery), true);

But when i drag my file in the ListBox (in RadWindow now), nothing appears (same behavior when i used ChildWindow) and events are nevers fired (i tested with breakpoints).
Could you help me please ?

Regards,
Guillaume

PS : I also add AllowDrop="True" in my RadWindow and "WindowLess" is false in the SL object.

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 29 Nov 2010, 10:25 AM
Hello Guillaume,

In order to achieve the desired functionality you might want to use Drop event and allowdrop property provided by the framework. RadDragAndDropManager is designed to provide drag and drop functionality within Silverlight plug-in.

I have prepared simplified version version of the scenario and seems that it works correctly. You might want to look at the logic you are using to upload files. I can suggest take a look at our RadUpload as it provides similar functionality.

Best wishes,
Tsvyatko
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Guillaume
Top achievements
Rank 1
answered on 29 Nov 2010, 04:11 PM
Hello,

Thanks for you attachment but i tried your solution in my project but without success.

I will continue to search.

Regards,
Guillaume
Tags
DragAndDrop
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Guillaume
Top achievements
Rank 1
Share this question
or