RadDiagramShapes stacking on top of each other!

3 posts, 1 answers
  1. Jacob
    Jacob avatar
    6 posts
    Member since:
    Mar 2013

    Posted 27 Mar 2013 Link to this post

    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. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 Apr 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jacob
    Jacob avatar
    6 posts
    Member since:
    Mar 2013

    Posted 01 Apr 2013 Link to this post

    Thanks Pavel! Between the suggestions in this thread and your reply to my support ticket, I figured out the problem! You guys rock! :)
Back to Top