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

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

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.


7 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team 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 : 
 
C# 
 
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. 
 
Regards 
Vijayalakshmi V.R. 



MA Mark 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


VR Vijayalakshmi Roopkumar Syncfusion Team 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.

Regards
Vijayalakshmi V.R.


SM Suriyaprabha Murugabaskaran Syncfusion Team 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.  
Regards, 
Suriyaprabha M. 



VR Vijayalakshmi Roopkumar Syncfusion Team 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:

http://syncfusion.com/Installs/support/patch/17.3.0.14/962358/F149324/SyncfusionPatch_17.3.0.14_962358_12112019080657085_F149324.exe

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:

http://syncfusion.com/Installs/support/patch/17.3.0.14/962358/F149324/SyncfusionPatch_17.3.0.14_962358_12112019080657085_F149324.zip

Nuget assemblies:
http://syncfusion.com/Installs/support/patch/17.3.0.14/962358/F149324/SyncfusionNuget_17.3.0.14_962358_12112019080657085_F149324.zip 

Assembly Version: 17.3.0.14

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\17.3.0.14\precompiledassemblies\17.3.0.26\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.

https://www.syncfusion.com/support/directtrac/patches  

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 17.3.0.14 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.

Regards,
Vijayalakshmi V.R. 



MA Mark 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


VR Vijayalakshmi Roopkumar Syncfusion Team 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.

 

Regards

Vijayalakshmi V.R.


Loader.
Up arrow icon