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

Disable drop on Treeview in a ChildWindow

1 Answer 29 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 01 Dec 2010, 10:30 AM
Hello,
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?

Thanks,
Alessandro

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 06 Dec 2010, 10:30 AM
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;

...

radTreeView.AddHandler(RadDragAndDropManager.DropQueryEvent,
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
Tags
TreeView
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or