Search an filter a treeview based on HierarchicalDataTemplate and CollectionViewSource

2 posts, 0 answers
  1. Doots
    Doots avatar
    13 posts
    Member since:
    Apr 2011

    Posted 27 Jul 2013 Link to this post


    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!

  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 31 Jul 2013 Link to this post

    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.

    Pavel R. Pavlov
    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 >>
Back to Top