i would like to move items with mouse and be able to cancel this operation with Esc key - cancel drag operation and move dragged item(s) back. How to do it correctly? I'm using MVVM patter if it does matter...
Thank you
Pavel
1 Answer, 1 is accepted
0
Martin Ivanov
Telerik team
answered on 18 Mar 2021, 07:48 AM
Hello Pavel,
There is no built-in functionality doing this, but you can customize the drag operations inside the diagram using its DraggingService. You can use the StartDragging event of the dragging service in order to save the original position of the shape and then in the KeyDown event handler of RadDIagram, you can stop the dragging action and restore original position of the shape in case Esc was pressed. For example: