This is a migrated thread and some comments may be shown as answers.

Virtualization and IsExpanded

1 Answer 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lauren Nickerson
Top achievements
Rank 1
Lauren Nickerson asked on 04 Jan 2011, 11:02 PM
I'm trying virtualization on the TreeView, and I have a RadTreeViewItem Style to set the IsExpanded property to true. If I set IsVirtualizing to true in the tree, the the Style does not apply, but if I set it to true, it does. Is there any way to fix this?

This is what my style looks like:

<Style TargetType="{x:Type telerik:RadTreeViewItem}">
    <Setter Property="IsExpanded" Value="True" />
</Style>

Thanks!

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Jan 2011, 01:50 PM
Hi Lauren Nickerson,

Do you really need to set the IsExpanded to all of the RadTreeViewItems? Actually, the UI Virtualization technique generates the visual containers (RadTreeViewItems) only when they are needed, when you need them in the viewable area. On the other hand, expanding an item also generates new containers. If you want to expand all items when the tree loads, all of the RadTreeViewItems will be generated and virtualization is needless. So you have to be clear about what you wish to achieve. Expanding all items ( when they are actually too many) makes bad performance which the virtualization wants to prevent.
You can find more info on Collapsing/Expanding items/ particular item here and more info about UI Virtualization here.
Hope this helped you. Feel free to ask if you have further questions.


All the best,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
TreeView
Asked by
Lauren Nickerson
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or