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

RadDiagram - Arrangement

1 Answer 114 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 06 Feb 2019, 11:45 AM

Hello,

I have RadDiagram with some shapes

I tried to arrange the shapes to be one on/under other and using send backward and bring forward actions, but there is a bug in that actions

The problem is that if I clicked send backward when the shape is already in backward and then click bring to front, I have to click the same times that I clicked send backward before (if I clicked 3 times after the shape was in backward, I have to click 3 times till the shape will bring to front)

I saw the bug also in telerik demos

How can I fix this bug?

Thanks

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 11 Feb 2019, 08:34 AM
Hello David,

The BringForward and SendBackward commands simply increment and decrement the value of the shape's ZIndex property. The commands don't take into account the ZIndex of the other shapes in the diagram. In other words, if you execute the SendBackward 10 times on an element with ZIndex=0, its ZIndex will become -10. Therefore, you will need to execute the BringForward command 10 times in order to return the old ZIndex (0). 

If you want to acheive a different behavior you can override the behavior of the commands. You can see how to do this in the Override Diagram Command article. In the SendBackward command executed handler you can update the ZIndex only if there are shapes with the same or lower ZIndex than the selected shape. And the opposite for the BringForward command. Update the ZIndex only if there are shapes with bigger or the same ZIndex.

Regards,
Martin Ivanov
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
Martin Ivanov
Telerik team
Share this question
or