This question is locked. New answers and comments are not allowed.
I am using RadTreeView and RadGrid to implement a file explorer. The RadTreeView shows just folders in their proper tree to allow swift navigation, and the RadGrid shows folders and files. I am trying to make it possible for a user to drag files from the grid to the folder view in order to move or copy files. We are not allowing folders to move, just files. In case it matters, the RadTreeView uses a Hierarchical Data Template to display its bound ItemsSource (an ObservableCollection) and is using LoadOnDemand to improve performance.
As such, I have managed to use RadDragAndDropManager to allow me to drag just file rows off the RadGrid, but I am having problems getting them to drop properly onto the RadTreeView. I have the following requirements:
1) RadTreeViewItems cannot be dragged (they are folders)
2) RadTreeViewItems are valid drop targets for the Grid rows.
3) The TreeView itself is not a valid drop target (just the items), and insertion is not allowed.
4) I need a specialized DropCue that changes based on whether the user is pressing the Shift key (this switches it between Move and Copy).
5) When the Grid row is dropped, it does not appear in the tree. Instead, the underlying file needs to be moved or copied.
I've tried "IsDragAndDropEnabled" on the RadTreeView: Didn't work because the RadTreeViewItems are draggable, and even when I figured out that I needed to handle DragQuery to stop that, the DropCue wasn't customizable anywhere I tried.
I've tried "RadDragAndDropManager.AllowDrop" on the RadTreeView: Didn't work because the e.Options.Destination is the treeview (this would be acceptable if there's a way to figure out which item we're on when dropping that I haven't found)
I've tried "RadDragAndDropManager.AllowDrop" in the Style of the RadTreeViewItems: Didn't work because I can't figure out how to make every item in the tree handle the DragAndDropManager events.
I'd appreciate any help with implementing this correctly. The last piece of any of these three approaches would be great, or some other path I can use to implement this.
--CHristina
As such, I have managed to use RadDragAndDropManager to allow me to drag just file rows off the RadGrid, but I am having problems getting them to drop properly onto the RadTreeView. I have the following requirements:
1) RadTreeViewItems cannot be dragged (they are folders)
2) RadTreeViewItems are valid drop targets for the Grid rows.
3) The TreeView itself is not a valid drop target (just the items), and insertion is not allowed.
4) I need a specialized DropCue that changes based on whether the user is pressing the Shift key (this switches it between Move and Copy).
5) When the Grid row is dropped, it does not appear in the tree. Instead, the underlying file needs to be moved or copied.
I've tried "IsDragAndDropEnabled" on the RadTreeView: Didn't work because the RadTreeViewItems are draggable, and even when I figured out that I needed to handle DragQuery to stop that, the DropCue wasn't customizable anywhere I tried.
I've tried "RadDragAndDropManager.AllowDrop" on the RadTreeView: Didn't work because the e.Options.Destination is the treeview (this would be acceptable if there's a way to figure out which item we're on when dropping that I haven't found)
I've tried "RadDragAndDropManager.AllowDrop" in the Style of the RadTreeViewItems: Didn't work because I can't figure out how to make every item in the tree handle the DragAndDropManager events.
I'd appreciate any help with implementing this correctly. The last piece of any of these three approaches would be great, or some other path I can use to implement this.
--CHristina