I'm looking for a way to drag-and-drop a row from a xamDataGrid to another component (i.e. treeView)
It seems like PreviewDragLeave, DragDrop.DrageLeave, DragLeave events are not really fired.
I've tried also using the MouseMove event:
void myGrid_MouseMove(object sender,MouseEventArgs e) { if(!_isDragging && e.LeftButton == MouseButtonState.Pressed) { _isDragging = true;
var row = myGrid....; DragDrop.DoDragDrop(myGrid,treeView.row,DragDropEffects.Move); } }
to no avail. Any ideas ?
Sounds great.
Thanks, that helped.
Using PreviewMouseMove and not MouseMove event solved the problem, and your sample answered some another 3-4 more questions ;-).
Thank you.
This code snippet looks just right and I am not sure why the rest of the events do not fire.
You can take a look at this sample implementation of drag-drop here:
http://forums.infragistics.com/blogs/alex_fidanov/archive/2009/07/28/drag-amp-drop-with-datapresenter-family-controls.aspx
Hope this helps.