Hello Marcin Danek,
You can handle the DropQuery event of the TreeView and do the check there.
Since the TreeView will normally handle the DropQuery event, you have to sign up using the method overload that lets you handle handled events, like so:
|orderView.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(TreeDropQuery), true);
This is used in the TreeToGrid drag drop example in the online examples.
There you have the TreeViewItem as e.Options.Destination
and the payload as well. Setting the e.Query Result
to false will make sure that the TreeViewDragCue will visually reflect the impossible drop.
You probably have realized this already, but your payload needs to be enumerable otherwise the TreeView will not accept it (e.g. if the payload is a single item, it will not work, you need to put it in a List).
On a side note, you can handle the DragQuery event by registering for the handled events as well but only one of the events will do.
Hopefully this will help you achieve what you need,
the Telerik team