Basically in the treeview, I have a list of items, if the item is of type “Group”, then I can add / drag drop items into it.
How can I achieve that in code? I tried DragEnter, DragOver events and setting the allowdrop property to false if the target item is not a group object but to no avail. Any advice please?
Cheers
You’ll want to set the Effects to None (or turn off Copy/Link/Move more specifically).
A good example of doing this programmatically is within TreeViewDragDropTarget itself, as it contains logic to similarly disable if you’re trying to drag an item under itself.
http://silverlight.codeplex.com/SourceControl/changeset/view/56962#779753
The relevant snippet: