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

Dropping on TreeView with validation

1 Answer 74 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Voltz
Top achievements
Rank 1
Voltz asked on 14 Sep 2011, 04:41 AM
we're trying to use drag and drop on a listbox and 2 tree views.

the premise is that listbox can drop into TreeView A but cannot drop into TreeViewB
TreeViewA has a 2 level hierarchy
TreeView A can drop the parent (1st level nodes) node (using say CustomerViewModel) into TreeViewB only
TreeView A can drop the child nodes (say for example ProductViewModel) back into the listbox only

TreeViewB  also has a 2 level hierarchy
TreeViewB cannot drop its parent node (1st level nodes which is of GroupViewModel) anywhere
TreeView can drop its child nodes (which is CustomerViewModel) back into TreeViewA

we tried adding a handler into the TreeView, but only AddDropInfoHandler is working. AddDropQueryHandler doesn't pass into the defined handler...

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 15 Sep 2011, 12:11 PM
Hi Voltz,

 You can use DropQuery event to achieve this. Since TreeView handles this event one need to attach to it using the following code:

using Telerik.Windows;
 
///
 
treeB.AddHandler(RadDragAndDropManager.DropQueryEvent,new EventHandler<DragDropQueryEventArgs>(OnDropQuery),true);

Let us know if you have any further issues.

Kind regards,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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