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

Avoid Automatic expansion of nodes and use of Virtualization

Thread ID:

Created:

Updated:

Platform:

Replies:

123322 Mar 8,2016 05:19 AM Mar 9,2016 07:10 AM WPF 2
loading
Tags: TreeViewAdv
sabrina c.
Asked On March 8, 2016 05:19 AM

I need to use the Treeview with data source that can contain hundreds or even thousands of nodes with levels that can drill down to a depth of 50 levels or more.
I've read the Chapter dedicated to virtualization of the source and I've implemented the IVirtualTree interface in the class I use as ItemsSource.
Unfortunately after  activating virtualization as in the sample, assigning the Items Source loaded with my data to the Treeview just blocks the UI and nothing is visible.
Eliminating the Virtualization properties the Data is shown after a Long delay when the nodes are more than a hundred.

What I'm not understanding, as said in the Subject is How to avoid the tree from expanding automatically all nodes so that the initial rendering is limited to the root node and the first level nodes and the underlying nodes are shown (and I hope rendered) only when expanded.



sabrina c.
Replied On March 8, 2016 07:12 AM

Ok, I have an addition to my question,
as usual Copy and Paste is nice but not always solves all problems:

I've found that my solution developed from your treeviewadv databinding sample has inside the following:

<Style TargetType="syf:TreeViewItemAdv" x:Key="itemsStyle">
	<Setter Property="IsExpanded" Value="True"/>
	<Setter Property="ImageHeight" Value="10"/>
	<Setter Property="ImageWidth" Value="10"/>
</Style>
This is why the tree is built with nodes expanded, now my question is: Seen that in my data node I've implemented the IsExpanded property of the IVirtualTree interface, is there a way to Bind the Expansion to the property in my data? Because if I simply take away the setter or set the IsExpanded value to False, the tree does not appear...
Regards
Sabrina






Priyanga Balasubramaniam [Syncfusion]
Replied On March 9, 2016 07:10 AM

Hi Sabrina,

Thank you for contacting Syncfusion Support.

We have checked reported query by creating a sample. But we were unable to reproduce the issue. In this sample we have implemented IVirtualTree interface and bound IsExpanded property to TreeViewItemAdv. For more information, please refer the sample from the below location.

Sample: Treeview_with_Virtualization

If the issue still persists, please revert with more information like detailed replication steps? It would help to proceed further.

Regards,
Priyanga B

CONFIRMATION

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.

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.

;