Hello Jb,
This can be done by validating the node that is about to be dragged and preventing the dragstart event. However, due to a bug in the treeview code, that didn't work. We resolved it in the attached JavaScript file, as well in all upcoming builds. Thanks for pointing us to it!
The following code will prevent first-level nodes from being dragged:
$(".k-treeview").data("kendoTreeView").bind("dragstart", function(e) {
if ($(e.sourceNode).parentsUntil(".k-treeview", ".k-item").length == 0) {
e.preventDefault();
}
});
However, you may also perform some validation while the user is dragging, and set the status class if the operation is not permitted through e.setStatusClass("k-denied").
Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework -
download Kendo UI now!