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

Problem with IsVirtualization=true property in tree view

1 Answer 60 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paresh
Top achievements
Rank 1
Paresh asked on 08 Jun 2010, 05:59 AM
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;
         break;
     }
}

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.

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 08 Jun 2010, 07:40 AM
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.

Greetings,
Valentin.Stoychev
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.
Tags
TreeView
Asked by
Paresh
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or