Filtering TreeView

2 posts, 0 answers
  1. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 08 Jul 2011 Link to this post

      I am trying to implement a filter to treeview items based on a textbox value used as a search string.  I figured I could evalute the FullPath property of a treeviewitem to insure all parent/children were included however the FullPath property seems to be coming across as Empty for me.  Is there something I am missing?  Here is my code:


    Private Function NameFilter(ByVal item As RadTreeViewItem) As Boolean

        If item.HasItems Then item.Items.Filter = New Predicate(Of Object)(AddressOf NameFilter)

        Return item.FullPath.Contains(txtSearchList.Text)

    End Function

  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 13 Jul 2011 Link to this post

    Hi Brent,

    Could you please send us the code that populates your RadTreeView ? Is it databound or declarative ? When the Tree is databound it is better to implement your own Path (string property) or GetPath() method. You can examine this article (using GetItemByPath) for further reference.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft R3 2016 release webinar banner
Back to Top