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

Drag & Drop on Child Window

2 Answers 117 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Alexy
Top achievements
Rank 1
Alexy asked on 07 Oct 2009, 08:59 PM
Hey,

When I try to run any example with Chil Window (I put any example on Chil Window), the Drag & Drop does not work properly,
I cannot drop anywhere!

Could you check it please.
Thanks.

2 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 10 Oct 2009, 09:13 AM

Hello Alexy,

Yes, the reason for this behavior is that the ChildWindow is in a Popup and popups open in a separate visual tree than the rest of the application. There is no way to enumerate or ask for the currently opened popups and therefore the DragDrop does not know about them.

The opened windows need to be manually registered. This has to be done for each DragDrop operation.  A good place to do this is the DragInfo handler. Add a DragInfo handler to the root of your application and check whether the status (e.Options.Status) is DragInProgress. Then add all open windows to the e.Options.ParticipatingVisualRoots collection. The windows will be searched for drop targets in order of appearance in the collection.

If you want to have just one handler to deal with this, it is best to register it with the AddHandler method, specifying that it should handle handled events as well, the syntax for this is:

this.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDropInfo), true);

AddHandler is an attached method and you need this using to see it:

using Telerik.Windows;

Does this work for you?

All the best,

Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mark
Top achievements
Rank 1
answered on 20 Apr 2011, 07:58 PM
Can you create a small mock up of this please - it would be very useful.

Many thanks,
Mark
Tags
DragAndDrop
Asked by
Alexy
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Mark
Top achievements
Rank 1
Share this question
or