We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Bowtie algorithm crashes

Hi,
I am using Syncfusion diagram in two views. I am using Bowtie algorithm for presentation of nodes and connectors. I am using this code in both views.

diagramModel.LayoutRoot = nodeList[0];
diagramModel.LayoutType = LayoutType.BowtieLayout;
BowtieLayout tree = new BowtieLayout(diagramModel, diagramView);
tree.RefreshLayout();

while switching between views I am getting this error.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.BitArray.Set(Int32 index, Boolean value)
at Syncfusion.Windows.Diagram.DiagramModel.Syncfusion.Windows.Diagram.IGraph.MakeTraversing(IShape node)
at Syncfusion.Windows.Diagram.BowtieLayout.InitializeLayout()
at Syncfusion.Windows.Diagram.BowtieLayout.StartNodeArrangement()
at Syncfusion.Windows.Diagram.BowtieLayout.RefreshPart()
at Syncfusion.Windows.Diagram.BowtieLayout.RefreshLayout()
at Syncfusion.Windows.Diagram.DiagramControl.DiagramControl_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


Looking for a positive response from your side.



2 Replies

NA nadeem February 7, 2012 09:52 AM UTC

Hi,
I am using Syncfusion diagram in two views. I am using Bowtie algorithm for presentation of nodes and connectors. I am using this code in both views.

diagramModel.LayoutRoot = nodeList[0];
diagramModel.LayoutType = LayoutType.BowtieLayout;
BowtieLayout tree = new BowtieLayout(diagramModel, diagramView);
tree.RefreshLayout();

One more thing is common in both views,sometime I redraw by canvas from XML file(if file exist),in that case I have not run the above code,if file doesnot exist I executed the above code.

So while switching between views I am getting this error.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.BitArray.Set(Int32 index, Boolean value)
at Syncfusion.Windows.Diagram.DiagramModel.Syncfusion.Windows.Diagram.IGraph.MakeTraversing(IShape node)
at Syncfusion.Windows.Diagram.BowtieLayout.InitializeLayout()
at Syncfusion.Windows.Diagram.BowtieLayout.StartNodeArrangement()
at Syncfusion.Windows.Diagram.BowtieLayout.RefreshPart()
at Syncfusion.Windows.Diagram.BowtieLayout.RefreshLayout()
at Syncfusion.Windows.Diagram.DiagramControl.DiagramControl_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


Looking for a positive response from your side.



RT Ramya Thirugnanam Syncfusion Team February 8, 2012 04:26 AM UTC

Hi Nadeem,

We are unable to reproduce this” ArgumentOutOfRangeException” issue in the reported scenario. We have created the simple sample to represent this. Please refer to the sample from the attachment.

Sample Details:
In that sample, we have used tab control with 2 tab items with same Diagram content.

Suggestions:

After analyzing the provided Stack Trace, the cause of this issue is absence of Layout root. So please verify that the LayoutRoot is properly set in your application.

If this response does not satisfy your requirement, please provide us the simple sample to reproduce this issue.

Please let us know if you have any concerns.
Regards,
Ramya




Sample_15a74a7.zip

Loader.
Live Chat Icon For mobile
Up arrow icon