Hi Gilbert Van Veen,
In your case you have to handle the OnDropQuery
() event and make sure that the items are dropped inside another item. You can do that by using the DropPosition
property of the RadTreeViewItem
if you also want to make sure that the destination item doesn't have other children you can use the RadTreeViewItem HasItems
property, and to check that the destination item isn't the root item of the tree you can use the RadTreeViewItem Level
property, which is 0 only for the root items.
sender, DragDropQueryEventArgs e)
RadTreeViewItem item = e.OriginalSource
var dropPosition = item.DropPosition;
(dropPosition == DropPosition.Inside && !item.HasItems && item.Level != 0)
I have prepared an example for you. Please take a look at it and let me know if it works for you.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items.