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

TreeLayout and IgnoreContainers

1 Answer 89 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 06 Apr 2015, 08:40 AM

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

This is result:

http://joxi.ru/L21RM8Quq4zWAX

But, while IgnoreContainers=true, result is:

http://joxi.ru/Vm6dpMLSqZvyAZ

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).

 

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Apr 2015, 12:43 PM
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,
          };
          sett.Roots.Add(this.diagram.Shapes[0]);
 
 
         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);
        
      }


Regards,
Petar Mladenov
Telerik
 

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

 
Tags
Diagram
Asked by
Max
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or