TreeLayout and IgnoreContainers

2 posts, 0 answers
  1. Max
    Max avatar
    6 posts
    Member since:
    Feb 2015

    Posted 06 Apr 2015 Link to this post

    Hello. I tried to apply tree layout on 50 generated nodes (by first tab).

    This is result:

    But, while IgnoreContainers=true, result is:

    Why  layouting don't work in this case? I don't want to involve containers in layouting algotithm.

    The screenshots are from your demo projects (xaml-sdk-master).


  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 07 Apr 2015 Link to this post

    Hello Max,

    Thank you for bringing this issue to our attention. Indeed, it's a bug in our RadDiagram and we logged it in our feedback portal where you can track its progress. We updated your telerik account points as thanks for your cooperation. 

    As a temporary workaround, you can save the containers positions in a dictionary and re-set them after Layout:
    Dictionary<RadDiagramContainerShape, Point> ContainerPositions = new Dictionary<RadDiagramContainerShape, Point>();
    private void RadButton_Click(object sender, RoutedEventArgs e)
              TreeLayoutSettings sett = new TreeLayoutSettings()
                  TreeLayoutType = TreeLayoutType.TreeDown,
                  IgnoreContainers = false,
             this.diagram.Shapes.OfType<RadDiagramContainerShape>().ForEach(x => ContainerPositions.Add(x, x.Position));
             this.diagram.DiagramLayoutComplete += (oo, ee) =>
                  this.diagram.Shapes.OfType<RadDiagramContainerShape>().ForEach(x => x.Position = ContainerPositions[x]);
             this.diagram.Layout(LayoutType.Tree, sett);

    Petar Mladenov

    See What's Next in App Development. Register for TelerikNEXT.

  3. DevCraft R3 2016 release webinar banner
Back to Top