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

Unhandled Exception when setting the Nodes Collection


I'm trying to use the SfDiagram control by creating a hierarchical collection of nodes (represented by their viewmodel) and setting the Nodes property. The issue is that when I call

ObservableCollection<IsolationStep> isolationSteps = (ObservableCollection<IsolationStep>)e.NavigationParameter;

diagram.Nodes = isolationSteps;

I get:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.UI.Xaml.Diagram.Layout.DirectedTreeLayout.GetLastChild(INode parent)
   at Syncfusion.UI.Xaml.Diagram.Layout.DirectedTreeLayout.AdjacentRight(IInternalNode shape)
   at Syncfusion.UI.Xaml.Diagram.Layout.DirectedTreeLayout.AllocateSpace(IInternalNode v, IInternalNode a, IInternalNode parent, IInternalNode prev, IInternalNode next)
   at Syncfusion.UI.Xaml.Diagram.Layout.DirectedTreeLayout.DoFirstWalk(IIn

Can you please provide with some guidance on what should be wrong regarding the Nodes collection that I'm using?

Thank you in advance.

4 Replies

RA Ranjitha Amirthalingam Syncfusion Team October 28, 2015 10:23 AM UTC

Hi Stergios,

Thanks for contacting Syncfusion Support.

Reported Scenario: Issue with Null Reference Exception.

We have analyzed the provided stack trace. We have suspect that the Info property of Node returns null value, which causes “Null Reference Exception”.

It would be better for us, if you would provide the sample to represent the reported scenario. This helps us to serve you better.

Ranjitha A.

ST Stergios November 1, 2015 08:10 AM UTC


I have attached a sample app that generated the problem.


Attachment: App1_e5ece0a5.zip

RA Ranjitha Amirthalingam Syncfusion Team November 3, 2015 01:09 AM UTC

Hi Stergios,

Reported Issue:Issue with Null Reference Exception.

Layout defines the relationship between Parent and Child Nodes. LineConnector  is used to create the relationship between Parent and Child Nodes. After analyzing your sample ,we came to know that Connector Collection is not created which causes the reported issue.

Ranjitha A.

RA Ranjitha Amirthalingam Syncfusion Team November 5, 2015 04:43 AM UTC

Hi Stergios,

We considered this “Null reference exception with Connector Collection” as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


Ranjitha A.

Live Chat Icon For mobile
Up arrow icon