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

RadDiagramShapes stacking on top of each other!

2 Answers 94 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 27 Mar 2013, 11:10 AM
Hi Telerik!

I have successfully implemented the RadDiagram into my application and I am dynamically loading data to populate the Shapes and Connections via my GraphSource. This works perfectly! The only issue I have left is that when I load the application, each Shape is now stacked on top of each other. I can move them around individually and all of the Connections are correct and it looks great once they have been moved manually. I was wondering if you have run into this problem before. I believe it has something to do with the TreeLayoutSettings but after inspecting them in the code behind it looks like the default settings have been loaded but I could be wrong. I have also tried initializing a different TreeLayoutSettings object and tried to set my "Root/Parent Node" via the Shapes[0] index and this still shows unexpected results (all shapes stacked on top of each other). This is the last hurdle I have to complete this application, and any help would be appreciated. Thank you! :)

Jacob

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 01 Apr 2013, 06:27 AM
Hi Jacob,

 You can try several techniques to avoid this problem:

  • Invoke the Layout operation in the GraphSourceChanged event handler of the RadDiagram. Please also set Width and Height to the RadDiagramShapes via Style. The GraphSource changed event fires after the shapes have been measured.
  • Invoke the Layout operation in the Loaded event handler in a Dispatcher body
  • Invoke the Layout operation in the SizeChanged event handler in a Dispatcher body
The usual reason for this issue is that the Layout is invoked too early and the shapes are not measured yet. We hope the first, or some of the other approaches proposed will fit in your scenario.
Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jacob
Top achievements
Rank 1
answered on 01 Apr 2013, 03:49 PM
Thanks Pavel! Between the suggestions in this thread and your reply to my support ticket, I figured out the problem! You guys rock! :)
Tags
Diagram
Asked by
Jacob
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Jacob
Top achievements
Rank 1
Share this question
or