Prevent drag and drop outside of branch
I have an AdvancedDataGrid that I populate with HierachialData from XML. I've 开发者_JAVA百科enabled drag and drop of the children nodes, but want to prevent a child node from being dropped outside of a branch. A child must always be in a branch.
How can I test if the dropped node is outside of a branch?
I managed to solve this using the dragComplete event where I check for any nodes that should be in a branch and copy the node and append it to the last found branch node and delete the dragged one.
If the user drags the leaf to the top of the tree it appends it to the first branch node. This also works well with being able to drag and drop leafs to closed branches.
Is there a way to move/re-parent nodes or am I limited to append a copy/delete old node?
精彩评论