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

How to find RadtreeViewItem By Source

1 Answer 67 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ZIBING
Top achievements
Rank 1
ZIBING asked on 05 Sep 2012, 03:49 PM
I have the code as below:

RadtreeView.Itemsource = sourceList1;
foreache ( var item in sourceList1)
{
     if ( sourceList2.Where(o=>o.ID==item.ID).Count()>0)
        {
            sourceList3.Add(item);
         }
}

My question is how to find the RadtreeViewItem in RadtreeView from sourceList3.

Thanks a lot

Zi

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 10 Sep 2012, 06:42 AM
Hello Zibing,

 You can use the RadTreeView.ItemContainerGenerator.ContainerFromItem method. However, this may be expensive. We highly suggest you to introduce a Path property in your business items and use the GetItemByPath method described here. Please let us know if you need further assistance.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
ZIBING
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or