Diagram and DirectedTreeLayout
I've created a simple app.
It creates a simple diagram. I've noticed that if a Diagram has no nodes and connectors and DirectedTreeLayout is applied then DirectedTreeLayout throws an exception right after the Load event.
Here is the callstack:
System.ArgumentOutOfRangeException
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Syncfusion.UI.Xaml.Diagram.Layout.DirectedTreeLayout.UpdateLayout()
at Syncfusion.UI.Xaml.Diagram.SfDiagram.DiagramLoadedEvent(Object sender, RoutedEventArgs e)
Here is the View constructor:
public MainPage()
{
this.InitializeComponent();
MainDiagram.Constraints = GraphConstraints.Relationship | GraphConstraints.Events | GraphConstraints.Zoomable;
MainDiagram.DefaultConnectorType = ConnectorType.Line;
MainDiagram.Nodes = new ObservableCollection<Node>();
MainDiagram.Connectors = new ObservableCollection<Connector>();
MainDiagram.LayoutManager = new LayoutManager()
{
Layout = new DirectedTreeLayout()
};
((DirectedTreeLayout) MainDiagram.LayoutManager.Layout).HorizontalSpacing = 30;
((DirectedTreeLayout) MainDiagram.LayoutManager.Layout).VerticalSpacing = 70;
((DirectedTreeLayout) MainDiagram.LayoutManager.Layout).SpaceBetweenSubTrees = 30;
((DirectedTreeLayout) MainDiagram.LayoutManager.Layout).Orientation = TreeOrientation.LeftToRight;
}
Any advice?
Thanks.
Hi Vladimir,
We are glad to announce
that our Essential Studio Volume 3 2013 is rolled out and is available for
download under the following link. The issue in SfDiagram
with Directed-Tree Layout throws the “ArgumentOutOfRangeException” while using
empty collection of Nodes and Connectors has been fixed in our latest release.
Please upgrade to the latest version of SfDiagram and
get back to us if you require any further assistance.
Please let us know if
you need any further assistance.
Regards,
Ramya
Thanks for the reply.
Well I've just tested the version 11.3.0.30.
It does not crash anymore but...
If I add one node without connectors and child nodes, Layout is not applied automatically.
More over, if I call right after node creation
diagramObject.LayoutManager.Layout.UpdateLayout();
it crashes again with the same error message as before.
If I create more then one node and connect them with connectors, layout automatically applied and everything looks good.
regards,
Vladimir.
Hi Vladimir,
Sorry about the
inconvenience caused.
The reported issue “ArgumentOutOfRangeException
with Directed-Tree Layout while using one node (RootNode) without connectors
and child nodes" is confirmed as a defect and we have logged an issue
report to fix this. This fix will be available in our upcoming WinRT service
pack release which is tentatively scheduled on end of this month.
Please let us know if
you need any further assistance.
Regards,
Ramya
- 4 Replies
- 2 Participants
-
VL Vladimir
- Sep 8, 2013 06:40 PM UTC
- Sep 17, 2013 09:41 AM UTC