Problem with IsVirtualization=true property in tree view

2 posts, 0 answers
  1. Paresh
    Paresh avatar
    1 posts
    Member since:
    Feb 2009

    Posted 08 Jun 2010 Link to this post

    Hi there,

    I am using RadTreeView control with IsVirtualization=true. and have thounds of data in tree.

    Now I want to search tree node dynamically.
    It is working find if the node being searched is visible in scroll bar, but if the node is at the bottom of the scrollbar and not visible within the hight of scroll bar, I am not able to find it through code as below:

    RadTreeViewItem tvRootItem=null;
    foreach (RadTreeViewItem tvItemChild in radTreeView.ChildrenOfType<RadTreeViewItem>())
         if ((tvItemChild.Item as ItemDto).Id.Equals(modelView.ActiveItem.Id))
             tvRootItem = tvItemChild;

    It is working fine it I set IsVirtualization=false, but in that case I am facing performance issue.

    Please help me to resolve with issue.
  2. Valentin.Stoychev
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Jun 2010 Link to this post

    Hi Paresh,

    This is the core difference between the virtualization and the normal rendering - the items are "virtualized" when they are not visible.

    What you should do is search in your collection and to select the item from there. It is not a good practice to examine the generated containers.

    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top