how to find the radtreeviewitem in the radtreeview using lamda expression ?

2 posts, 0 answers
  1. sunil nair
    sunil nair avatar
    1 posts
    Member since:
    Mar 2010

    Posted 15 Dec 2011 Link to this post


    I'm using the silverlight version of Radtreeview control. 

    I'm loading the tree using this method - radtreeview.items.add(radtreeviewitem).

    I need to filter out  the radtreeviewitem in the radtreeview by it's name.

    I use the following lamda expression for the same, it only filters out the radtreeviewitem which is directly under the root node, but is not able to filter out the radtreeviewitem which is the child item of items directly under the root nodem i.e not able to search all children.

    radTreeView.Items.Cast<RadTreeViewItem>().FirstOrDefault().Items.Cast<RadTreeViewItem>().Where(q => q.Name == StrParentKey)

    Basically I am looking to achieve the same thing which can be done in windows treeview control like

    tree.Nodes.Find(StrParentKey,    -- the second parameter true will make sure it searches all children


    Could someone please help me ?


  2. Petar Mladenov
    Petar Mladenov avatar
    3162 posts

    Posted 19 Dec 2011 Link to this post

    Hi Sunil Nair,

    I prepared a sample project where I use your code and implement successful search by the RadTreeViewItem's Header and Name.

    Could you please check it out and let us know if we have missed something or just modify it so that the problem is reproducible? Thank you in advance for your cooperation.

    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top