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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hiding nodes in tree view causes exception

Thread ID:





144205 Apr 24,2019 04:07 PM UTC Apr 30,2019 06:49 AM UTC WinForms 5
Tags: MultiColumnTreeView
Asked On April 24, 2019 04:07 PM UTC

I have a list of nodes in the tree view that I would like to hide.

I use this code:

 NodeList.ForEach(k => {



              k.Visible = false;

            }catch (Exception e){




 Sometimes I get:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Windows.Forms.Tools.MultiColumnTreeView.TreeNodeAdv.set_Visible(Boolean value)

The node I am working on is a valid node. It has text properties and is certainly not null.

What can be going wrong?

Sabaridass Ramamoorthy [Syncfusion]
Replied On April 26, 2019 11:28 AM UTC

Hi Lenny, 

Thanks for contacting Syncfusion Support. 

We have checked the reported issue – “Exception was thrown when hiding the tree nodes” in our working sample. Unfortunately we are unable to reproduce the reported issue in our side. Kindly refer to attached video and sample from below location. 

Could you please modify the attached sample to reproduce the reported issue? So that it would be helpful for us to proceed further. 

Sabaridass R 

Replied On April 26, 2019 08:01 PM UTC

Hi Sabaridass,
We have found that the TreeView property of the Node is set to null sometimes after visibility changes (or other behavior).
When we restore that reference, the problem goes away.

Please also check your Visibility setter. Gives a problem if TreeView is set to null

Sabaridass Ramamoorthy [Syncfusion]
Replied On April 29, 2019 10:26 AM UTC

Hi Lenny,

Based on your previous update, we have prepared a patch for testing purpose by checking the null values proactively in Setter method of Visible property. Kindly test the below patch and let us know whether the reporting problem is resolved at your end. Based on your update we could proceed further on this query.

Recommended approach – exe will perform automatic configuration     
Please find the patch setup here:                           
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment                      
Please find the Nugets from the below location:     
You can change how you receive bug fixes by navigating to the following link and updating your preferences.
Sabaridass R 

Replied On April 29, 2019 04:48 PM UTC

Hi Sabaridass,

We found many other issues related to the node visibility issue. We opened case #234751  in Direct Trac, because we need a faster resolution.

Hopefully they can be addressed.

Sabaridass Ramamoorthy [Syncfusion]
Replied On April 30, 2019 06:49 AM UTC

Hi Lenny, 
Thanks for the update. We can address the reported issues in #234751 and you can follow up the same if you need any further assistance on this. 
Sabairdass R 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon