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

Treeview cancel drop event

1 Answer 204 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Naveen
Top achievements
Rank 1
Naveen asked on 11 Mar 2014, 11:56 AM
I am creating folders in tree structure like we have windows explorer.My requirement is that if I am dropping a node into another node and the target node already contains a node with the same name as of source node then the source node should be placed back to its original position.The checking of same node name takes place in the controller and it returns false if it's duplicate.At this moment, I want to move the node at it's original position.I have tried e.setValid(false) and e.preventDefault() but it's not working. Please provide me the solution.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 13 Mar 2014, 09:47 AM
Hello Naveen,

You could use the TreeView's drag event to check whether the node you are dragging over has an item with the same name as the dragged item. For convenience I prepared a small example here, I hope it helps.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Naveen
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or