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

Implement custom search

3 Answers 392 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Nico asked on 09 Sep 2019, 09:11 AM

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

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 12 Sep 2019, 06:43 AM
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.

0
Nico
Top achievements
Rank 1
answered on 16 Sep 2019, 06:34 AM

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

0
Dinko | Tech Support Engineer
Telerik team
answered on 18 Sep 2019, 01:31 PM
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.
Tags
TreeListView
Asked by
Nico
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Nico
Top achievements
Rank 1
Share this question
or