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

Search an filter a treeview based on HierarchicalDataTemplate and CollectionViewSource

1 Answer 261 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Doots
Top achievements
Rank 1
Doots asked on 28 Jul 2013, 04:22 AM
Hi,

I am trying to search and filters the content of a RadTreeView based on a HierarchicalDataTemplate. The user type a string into a search TextBox and on the TextChanged event of this textbox, the content of the treeview is filtered, according to the user input.

I am trying to do exactly what is done by the solution explorer of Visual Studio 2012. I have read a lot of articles and forums but i didn't find a solution yet. I am using a RadTreeView, a CollectionViewSource as datasource. My RadTreeView contains 3 different objects on three levels. I am using MVVM Light.

If anyone have an idea or even better, a solution, please share it :). Thank you in advance for your help!

Regards,
Doots

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 31 Jul 2013, 01:52 PM
Hi Doots,

The RadTreeView control is designed to visualize large amount of hierarchical data and functions like filtering, searching and sorting are not supported out of the box. In order to achieve your requirement you need to apply those functions to the ItemsSource collection of the RadTreeView control and the control will update its UI.

I am happy to inform you that there is a downloadable project in our XAML SDK which can be used as a start up project.

Furthermore, if you use CollectionViewSource, please take a look at the attached project and see how we use it.

I hope that this information will help you.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeView
Asked by
Doots
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or