This is a migrated thread and some comments may be shown as answers.

Rotate diagram shape using squares

3 Answers 96 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 26 Jul 2019, 06:46 AM

I am using diagram shapes on radDiagram

I want to rotate the line shape by using the squares arround the shape wnd not with the rotate icon in the top

I attached an image.

as you can see, I want rotate the line by the squares that I marked in red and not with the icon that I marked in yellow

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Jul 2019, 01:53 PM
Hi David,

Thank you for the provided image.

Rotating a shape using its resizing handles is not supported out of the box. You could try to achieve it using custom code. What comes up to my mind is to create custom RotationService. Then using mouse events of the ManipulationAdorner and RadDiagram you can rotate the shape.

I have prepared a sample project which demonstrates this approach. You can additionally modify it, so it fits in your main application.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
David
Top achievements
Rank 1
answered on 31 Jul 2019, 06:07 AM

Thank you for the answer

but it is not exactly what I wanted because I need to rotate with resize the line

and in your attached code I can only rotate

Can you please modify your demo project that the resize and rotate will be in the same time

(during drag one corner the line's size will be changed according the mouse point and also rotate the line (as line in office word)

Thanks!

0
Dinko | Tech Support Engineer
Telerik team
answered on 01 Aug 2019, 11:55 AM
Hello David,

I need to point here that triggering both services at the same time will cause conflict and unexpected behavior. The RadDiagram does not support this, and I would suggest you avoid such a scenario. In the attached project (from my previous reply), I have forbidden the resizing by handling the PreviewResize method. You can remove the setting of the Handled property.
private void RadDiagram_PreviewResize(object sender, ResizeRoutedEventArgs e)
{
    //  e.Handled = true;
}

You will need to create custom logic which handles all scenarios when both services are manipulating the shape at the same time.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

Tags
Diagram
Asked by
David
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
David
Top achievements
Rank 1
Share this question
or