How to find RadtreeViewItem By Source

2 posts, 0 answers
  1. ZIBING
    ZIBING avatar
    1 posts
    Member since:
    Sep 2012

    Posted 05 Sep 2012 Link to this post

    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
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Sep 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top