Drag & Drop on Child Window

3 posts, 0 answers
  1. Alexy
    Alexy avatar
    11 posts
    Member since:
    May 2009

    Posted 07 Oct 2009 Link to this post


    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.
  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 10 Oct 2009 Link to this post

    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,

    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.
  3. DevCraft banner
  4. Mark
    Mark avatar
    155 posts
    Member since:
    Oct 2010

    Posted 20 Apr 2011 Link to this post

    Can you create a small mock up of this please - it would be very useful.

    Many thanks,
Back to Top