Hi,
I use an Image that is shown when dragging:
I use an Image that is shown when dragging:
args.DragVisual = new ContentControl { Content = MyImage, Width = 25, Height = 25 };This image always shows up at a certain position relative to the cursor. Can I influence this position? I tried DragVisualOffset but - maybe I used it incorrect - that didn't result in a change of position. Thanks in advance, Vincent
4 Answers, 1 is accepted
0
Hello Vincent,
Nik
the Telerik team
You can use the DragVisualOffset property in combination with the RelativeStartPoint properties of the DragInitializeEventArgs to achieve the desired effect.
Hope this helps!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Vincent
Top achievements
Rank 1
answered on 03 Dec 2012, 03:42 PM
Hello Nik,
the property RelativeStartPoint has an internal setter which I therefore can't change in the OnDragInitialize eventhandler which is passed to the DragDropManager:
Should I change this property (together with DragVisualOffset) somewhere else instead of in this handler?
Kind regards,
Vincent
the property RelativeStartPoint has an internal setter which I therefore can't change in the OnDragInitialize eventhandler which is passed to the DragDropManager:
DragDropManager.AddDragInitializeHandler(control, OnDragInitialize, true);
Should I change this property (together with DragVisualOffset) somewhere else instead of in this handler?
Kind regards,
Vincent
0
Accepted
Hello Vincent,
Nik
the Telerik team
The RelativeStartPoint property gives you the relative coordinates of the mouse pointer when starting a drag operation. You cannot set it. You can use it to calculate your own offset, and set it to the DragVisualOffset propery.
Hope this helps!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Vincent
Top achievements
Rank 1
answered on 04 Dec 2012, 08:12 AM
Hi,
the reason it didn't work in my case was that I probably used absolute X,Y-coordinates instead of calculated relative to RelativeStartPoint. I found the right piece of code in this topic:
http://www.telerik.com/community/forums/silverlight/diagram/drop-event-of-raddiagram-is-not-working.aspx
Thanks,
Vincent
the reason it didn't work in my case was that I probably used absolute X,Y-coordinates instead of calculated relative to RelativeStartPoint. I found the right piece of code in this topic:
http://www.telerik.com/community/forums/silverlight/diagram/drop-event-of-raddiagram-is-not-working.aspx
Thanks,
Vincent