Disable drop on Treeview in a ChildWindow

2 posts, 0 answers
  1. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 01 Dec 2010 Link to this post

    my scenario is this:

    1) 1 ChildWindow with Treeview and Listbox
    2) The drag and drop between Treeview and Listbox works (I have handled the DragInfo event and add the window to the PartecipatingVisualRoots list)
    3) I want to disable the drop event on the Treeview. The items can only be dragged from the Treeview to the Listbox

    I need help for the third point.
    I handled the DropQuery event in the Treeview, but the event doesn't fire. It's the only event that doesn't fire on the Treeview. The DragInfo and the DropInfo works correctly.
    I would like to use the DropQuery event to disable the drop in all the Treeview area.

    Why does the DropQuery event doesn't fire?
    There is an alternative method to disable the drop for all the Treeview control?

  2. Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 06 Dec 2010 Link to this post

    Hi Alessandro,

    The RadTreeView control handles internally the RadDragAndDropManager DropQuery event in order to implement its built-in drag/drop logic. Therefore you need to attach the OnDropQuery event handler like so:
    using Telerik.Windows;


    new EventHandler<DragDropQueryEventArgs>(OnDropQuery), true);

    Setting the bool parameter to true will register the handler to be invoked even when the routed event is marked handled.  Give this a try and let us know if you need more info.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top