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

Filtering TreeView

1 Answer 81 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 2
Brent asked on 08 Jul 2011, 05:12 PM
Hello,
  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


1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 13 Jul 2011, 03:08 PM
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!

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