Null reference exception during diagram layout

I have a diagram with several nodes all at the same position (not properly laid out, the user is supposed to move them). And two of the nodes have a connection between them. I get an exception as soon as the window with the diagram is shown.


Value cannot be null. Parameter name: source

at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Syncfusion.UI.Xaml.Diagram.Layout.FlowchartLayout.CreateVertex(IInternalNode node)
at Syncfusion.UI.Xaml.Diagram.Layout.FlowchartLayout.UpdateLayout()
at Syncfusion.UI.Xaml.Diagram.Panels.DiagramPage.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()


There is no exception if the nodes are not at the same position or if there is no connection between them. Any suggestions how to prevent this apart from forcing some kind of layout?


4 Replies 1 reply marked as answer

ES Edgars Sults January 26, 2022 10:16 AM UTC

I resolved this by not setting a layout manager. 😐


Marked as answer

KR Karkuvel Rajan Shanmugavel Syncfusion Team January 28, 2022 05:32 AM UTC

Hi Edgars, 
 
Reported issue: Null Reference Exception while using several nodes in same position in the layout. 
 
Sorry for the inconvenience caused. 
 
Currently, we are validating the reported issue on our end. Please share us the following details so that we could provide you the solution as early as possible from our end. 
 
  • We need the DataSource used in your application to reproduce the issue on our end.
 
Please share the necessary details with code example and explain your issue in detail with video representation. 
 
Regards, 
Karkuvel Rajan S 



ES Edgars Sults January 28, 2022 09:26 AM UTC

Hi, we've moved on from this issue, can't provide the node data right now. We will revisit this if we encounter it again in the future.



KR Karkuvel Rajan Shanmugavel Syncfusion Team February 1, 2022 06:44 AM UTC

Hi Edgars, 
 
Please let us know if you encounter any issues further as we will always be glad to assist you. 
 
Regards, 
Karkuvel Rajan S 


Loader.
Up arrow icon