I almost have this working and just need some guidance on whether I'm going about this correctly and more importantly how to fix the tiny issue I am having.
I have uploaded a small sample project with the problem mentioned below.
I want to be able to drag multiple grid rows from the XamGrid to a XamTree. I don't physically need anything to move or change, I just need it to appear to the user they are dragging something to a specific XamTreeitem.
By crawling the forums I found a couple different approaches to this. Non seemed to be a perfect fit or to work completely but I was able to splice together something that almost works.
Approach
I loaded the tree nodes dynamically in code-behind and call SetDropTarget to specify which nodes are DropTargets. Working perfectly.
I could not figure out how to get XamGrid row's to be Drag Source objects. I posted elsewhere about this but know one has replied.
I found an example where they provided a custom DragTemplate at the XamGrid level. I put a TextBlock in the DataTemplate with Text="" so I basically get what I want. Just the default drag cursor and not the whole entire grid moving. This seems to work and I have only one issue with the XamGrid.
After the drag is finished, if I move the mouse back to the XamGrid, it starts selected all rows until I refocus or re-click the grid. Its like something gets messed up with its Visual State.
Any help would be greatly appreciated.
Hello,
It's because of a bug of DragDrop. A new service release is expected in next few days where this issue is fixed.
Best regards.Plamen.
Great! I eagerly await the service release.
I have 1 more problem to figure out. Grid rows can only be dragged to certain folders. I was originally thinking that I could set DropChannel and DragChannel but since I cannot figure out how to set the drag source on a row by row basis this doesn't appear to be an option.
How would your recommend that during that dragover I calculate that the grid row (or rows) is actually allowed to be dropped on this particular XamTreeItem and if its not, change curror back to not allowed?
I think this is my last hurdle.
Thanks in advance!
Ken