Virtualization and IsExpanded

2 posts, 0 answers
  1. Lauren Nickerson
    Lauren Nickerson avatar
    52 posts
    Member since:
    Jul 2009

    Posted 04 Jan 2011 Link to this post

    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" />

  2. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 05 Jan 2011 Link to this post

    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
Back to Top