Hi,I'm trying to implement my own simple Drag and Drop functionality on an XamDataGrid. I need to drag multiple records(all selected records), after right mouse down and mouse moving a defined delta X or Y distance. I cant manage this, because after right mouse down and holding right mouse down no other events are fired.
I also tryed it with the Preview Events, without success.
MouseRightButtonUp is also not fired, why?
I'm using Infragistics WPF 15.1.20151.2055
Sample Project is attached.
Maybe someone can tell me what I'm doing wrong? or what can be the solution?
Thanks
Hello Florian,
Thank you for your post.
I have been looking into it and the sample application you have attached and I am not sure that I understand correctly your requirements. It seems that currently our XamDataGrid does not support built-in the functionality for dragging multiple records.
Would you please provide me with some more details about what you are trying to achieve. You can take a look at the following forum thread, where similar functinality was discussed:
http://ko.infragistics.com/community/forums/t/62066.aspx
I have updated the sample application you have provided, in order to show you a possible approach for implementing drag and drop of a multiple records of the XamDataGrid to other grid, by using MouseRightButtonDown event. Basically I get the selected records from SelectedRecords collection of main grid in the event handler of MouseRightButtonDown. I handled the Drop event of the grid which used for container and added the selected records from main grid. Please let me know if I am missing something from your scenario.
Looking forward to earing from you.
Hello,thank you for your quick response. Well you are right i mixed some right and left clicks in my first post. sorry :)Related to your Sample, change the MouseRightButtonDown Event to MouseLeftButtonDown Event. Is also working for all selected rows.But i don't want to start the drag operation immediately! I want to start it after the mouse cursor moved some distance while mouse left button is down.So i tryed to save the Cursor Position in the MouseLeftButtonDown Event and then in the MouseMove Event check if the cursor moved some distance and afterwards start the drag operation. But the mousemove event is not fired.
I modified your sample and attached it.
I have been looking into your requirements and the sample application you have provided. What I can suggest is to try to use MouseMove event of the MainWindow instead of MouseMove for DataRecordCellArea and implement your logic in this event handler. Also you can handle the PreviewMouseLeftButtonDown event. I modified the sample application in order to show you how you can implement this approach.
Please let me know if you require any further assistance on this matter.
I am just checking if there is anything else I can do for you.