Implement custom search

4 posts, 0 answers
  1. Nico
    Nico avatar
    2 posts
    Member since:
    Sep 2019

    Posted 09 Sep 2019 Link to this post

    Hello

    We are facing the challenge, to present tasks to our customers.
    Each task can consist out of n tasks, but can also stand alone. These child-tasks should be displayed in a hierarchical manner and must be searchable (down to the tree-leaves).

    Now we have been wondering if it's easier to build a hierarchy in a GridView, where the Search is implemented, or use the TreeListView, which meets our hierarchical needs.
    Since the hierarchical GridView creates new Grids for each hierarchy-level, it seems quiet challenging for me, too.

    For the TreeView, you are providing an search-example:
    https://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/implement-search-filter-sort
    can this be adopted for the TreeListView?
    I'm also wondering, if the search-box from GridView is accessible somehow in the TreeListView somehow.

    So our main-concern is, which control is the way to go?

    We are grateful for any advice you can give us.

    Best Regards

    Nico

  2. Dinko
    Admin
    Dinko avatar
    995 posts

    Posted 12 Sep 2019 Link to this post

    Hello Nico,

    Thank you for your interest in our Telerik UI for WPF components.

    Searching through the child records is not supported by the RadGridView. The search mechanism of RadGridView is tightly coupled to its filtering engine. It performs the search over the Items collection of the main grid. Moreover, the control is not aware of what element is defined within its HierarchyChildTemplate/RowDetailsTemplate.

    Nevertheless, the RadTreeListView derives from RadGridView and support most of its features, the search-as-you-type functionality is not one of them. Our main concern in the RadTreeListView is that this feature can be applied only on the parent items since the children are not always available and the control knows basically only for the parent items. The same is the case with filtering. Thus, the behavior for searching would have seemed incomplete and not fully functional. 

    The best option here is to use RadTreeView control for displaying hierarchy data. For the search functionality, you can implement a custom one. This approach is described in the mentioned article in your post. In our GitHub repository, we have an SDK example based on the information in this article.

    Regards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

  3. Nico
    Nico avatar
    2 posts
    Member since:
    Sep 2019

    Posted 16 Sep 2019 Link to this post

    Hello Dinko

    Thank you for your reply.

    You are suggesting to use the RadTreeView. The issue here is, that our tasks have multiple properties which have to be presented to our customers, like "name", "state", "scheduled-time" etc.
    We also want to maintain the sort-functionality.

    As I see it, this is not possible using the RadTeeView, is it?

    I am also considering to apply a custom search-algorithm on the input for the RadTreeListView.

    Best Regards
    Nico

  4. Dinko
    Admin
    Dinko avatar
    995 posts

    Posted 18 Sep 2019 Link to this post

    Hi Nico,

    Using RadTreeView you can show multiple properties. You can use the ItemTemplate property of the control. Creating custom DataTemplate you can set several TextBlocks which binds to different properties. You can take a look at the Hierarchical Data Templates help article for more information. The sort functionality will need to be created using custom code.

    Regarding RadTreeListView control. As there's no search implementation, what comes up to my mind to implement a custom search functionality using a TextBox control. You can placed next to the RadTreeListView and when its Text changes you can use the filtering capabilities of the control to show the searched results.

    R
    egards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top