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

How do I collapse the visibility of the expand/collapse button and make the tree view adv auto collapse parent rows?

Thread ID:





149324 Nov 21,2019 06:03 PM UTC Dec 12,2019 12:42 PM UTC WPF 7
Tags: TreeViewAdv
Asked On November 21, 2019 06:03 PM UTC

My TreeViewAdv is strictly designed to show everything inside the collection so I have no need for the collapsing/expanding button, I want the TreeViewAdv to be auto collapsed as well. How do I remove the collapse/expand toggle button? I want it collapsed and not hidden because I need the pixel space it's taking up.

Vijayalakshmi Roopkumar [Syncfusion]
Replied On November 22, 2019 01:08 PM UTC

 Hi Mark, 
Thank you for contacting Syncfusion Support. 
Query : How do I remove the collapse/expand toggle button? I want it collapsed and not hidden because I need the pixel space it's taking up. 
We have checked the reported query and understood that you want to collapse the expander of TreeViewItemAdv. In order to achieve it, you can get the expander instance using VisualUtils and set its visibility as collapsed. Please find the code for the same from the following : 
private void TreeViewAdv_Loaded(object sender, RoutedEventArgs e) 
Expander expand = VisualUtils.FindDescendant(treeview, typeof(Expander)) as Expander; 
if(expand != null) 
expand.Visibility = Visibility.Collapsed; 
We have also attached the sample for your reference . Please download it from the following location: 
Please try this solution and let us know if it is meet your requirement. 
Vijayalakshmi V.R. 

Replied On November 22, 2019 02:39 PM UTC

Thanks for the help, unfortunately the solution is still quite not there yet, there's still something on the left of the text that's invisible, could probably be the root lines so I put ShowRootLines = "false" but now there's just a blank space on it. I really need that blank space to disappear. I've attached a rar file containing an image showing what you've sent and what I wanted it to look like. Thank you very much.

Attachment: TreeViewAdvNew_e88843b4.rar

Vijayalakshmi Roopkumar [Syncfusion]
Replied On November 25, 2019 12:52 PM UTC

Hi Mark

Thank you for your update.

We are currently analyzing your reported requirement regarding TreeViewAdv. We will check and update the details by 27th Nov 2019.

Vijayalakshmi V.R.

Suriyaprabha Murugabaskaran [Syncfusion]
Replied On November 27, 2019 02:00 PM UTC

Hi Mark, 
Thank you for your information. 
We have analyzed the reported problem in TreeViewAdv and we could able to reproduce the issue. We have considered this as defect and logged a defect task. We will provide you a patch on 11th December, 2019. Until then you can track this issue using the following feedback link.  
Suriyaprabha M. 

Vijayalakshmi Roopkumar [Syncfusion]
Replied On December 11, 2019 01:57 PM UTC

Hi Mark,

Thank you for your patience.

We have fixed the reported issue “Expander is not hide properly while using ShowRootLines as False” . The patch for the same can be downloaded from the following location:

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 patch assemblies alone from:


Nuget assemblies:

Assembly Version:

Installation Directions:
This patch should replace the files “Syncfusion.Tools.WPF” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\\precompiledassemblies\\4.6

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.

Note: To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode.


Disclaimer: If you have received other patches for the same version for other products, please apply all patches in the order received. Please note that we have created this patch for version specifically to resolve the following issue reported in the incident 149324. It would be include in our upcoming volume 4, SP1 release 2019.

Please try with this patch and let us know whether this issue get resolved at your end.

Vijayalakshmi V.R. 

Replied On December 11, 2019 06:32 PM UTC

Thank you so much for the update, however, after applying this to the sample you gave earlier in this thread (and after a few modifications such as applying an mvvm approach and populating it through code rather than manually setting it up on xaml), I've encountered tons of new problems:

1. Only the first row's toggle triangle button is hidden, I could see the toggle triangle button on all other rows.

2. If you drag the first row (that has the hidden toggle button) and simply let go of it after moving it a few pixels, the collapse toggle triangle button appears again

3. If I spam click my own toggle button (This is not a replacement to toggle the main row, this does something else on my main program), there are two more problems happening. It's difficult to reproduce it though, sometimes they appear after a few clicks, sometimes it's after numerous ones:
    3.a. The "textblock" with the name bound to it turns into a "textbox", yes a "textbox", for some reason it turns into a textbox where you could manually change the name which is definitely something I don't want, in fact I used a textblock for this specific reason, I just want to show the name property, I don't want the users changing anything.
    3.b.  I get a "System.ArgumentOutOfRangeException" error.

4. All the rows are still not permanently expanded

5. The user still has the ability to toggle expanding the tier 1 rows, I've made it clear on the earlier replies that I need this tree view adv to Auto collapse every row and DON'T ALLOW the user to un-collapse it.

Attachment: WpfApplication17_70aefd42.rar

Vijayalakshmi Roopkumar [Syncfusion]
Replied On December 12, 2019 12:42 PM UTC

Hi Mark,


Thank you for your update.


We have checked your query and we were able to reproduce the reported behavior on dragging the TreeViewItems. We are currently validating your reported behavior with TreeViewAdv in source level. We will check and update you the complete details on or before 16th Dec 2019.



Vijayalakshmi V.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