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

How can I filter on all the hierarchy but not only top level?

9 Answers 185 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Ke
Top achievements
Rank 1
Ke asked on 12 Dec 2011, 08:01 AM
I want to filter the data of all the level, however, it seems treelistview only filter data on top level.
How to do that?

9 Answers, 1 is accepted

Sort by
0
Ke
Top achievements
Rank 1
answered on 12 Dec 2011, 11:36 AM
Sorry it can work. It is my mistake. Please close this topic.
0
Dimitrina
Telerik team
answered on 12 Dec 2011, 12:31 PM
Hello Ke ,

Yes, you are right, the TreeListView will in fact filters on all levels. If you type in something in one of the two text-boxes in the lower part of the filtering control, you will see that the filtering occurs on all currently loaded data on all levels. Still it shows distinct values from the top-level only. 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
gans
Top achievements
Rank 1
answered on 20 May 2012, 07:41 PM
Is this a BUG ? Why the Distinct values don't show on the lower level nodes? It would be so much easier to filter that way. 
0
Vlad
Telerik team
answered on 21 May 2012, 06:48 AM
Hello,

 To get distinct values for sub levels we need to expand them - this can be very time consuming or even unexpected especially when you have load on demand for child items. To achieve your goal I suggest you to handle DistinctValuesLoading event and provide your own values in e.ItemsSource.

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
gans
Top achievements
Rank 1
answered on 21 May 2012, 11:21 PM
Vlad,

Do you have an example that does this please?
0
Vlad
Telerik team
answered on 22 May 2012, 07:44 AM
Hello,

 I'm afraid I cannot give general example how to achieve this. Maybe it will be better to create your own collection with all level values depending on your case. As for the event you can check this blog post for more info:
http://blogs.telerik.com/vladimirenchev/posts/10-01-07/how-to-populate-radgridview-for-silverlight-distinct-filters-asynchronously-using-wcf-ria-services.aspx

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
gans
Top achievements
Rank 1
answered on 22 May 2012, 05:50 PM
Vlad,

That blog helps. thanks. 
0
Lisitsa
Top achievements
Rank 1
answered on 04 Oct 2016, 09:50 AM

Hello!

To get distinct values for sub levels we need to expand them - this can be very time consuming or even unexpected especially when you have load on demand for child items

What if I want to explicitly load all items? For example, if I'm not using load on demand?

I have tried to use the existing code, but the method GetDistinctValuesCore is internal :( I think that all that's needed is to use items from all levels, not just from the ItemsSource.

Can I use built-in mechanism toreceive distinct values from all items, not from the top leves ones? Can this feature be implemented in future releases? I have tried to add a feature request, but I get the following error: "An error occurred while processing your request".

Thank you!

0
Yoan
Telerik team
answered on 07 Oct 2016, 09:02 AM
Hi Lisitsa,

By default distinct values in RadTreeListView are loaded only from the root level items - our logic for getting the distinct values uses the GetDistinctValuesCore method, however, it will fetch only the root items. So, there is no built-in method which is suitable for your scenario. What you can try is to follow Vlad's suggestion for assigning your custom collection to e.ItemsSource in DistinctValuesLoading event.

I've logged this as a feature request in our Feedback and Ideas Portal at the following page - Add a way to display all distinct values for sub levels.

Regards,
Yoan
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeListView
Asked by
Ke
Top achievements
Rank 1
Answers by
Ke
Top achievements
Rank 1
Dimitrina
Telerik team
gans
Top achievements
Rank 1
Vlad
Telerik team
Lisitsa
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or