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

10 posts, 0 answers
  1. Ke
    Ke  avatar
    12 posts
    Member since:
    Sep 2011

    Posted 12 Dec 2011 Link to this post

    I want to filter the data of all the level, however, it seems treelistview only filter data on top level.
    How to do that?
  2. Ke
    Ke  avatar
    12 posts
    Member since:
    Sep 2011

    Posted 12 Dec 2011 Link to this post

    Sorry it can work. It is my mistake. Please close this topic.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  5. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 20 May 2012 Link to this post

    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. 
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 May 2012 Link to this post

    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 >>

  7. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 21 May 2012 Link to this post

    Vlad,

    Do you have an example that does this please?
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 May 2012 Link to this post

    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 >>

  9. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 22 May 2012 Link to this post

    Vlad,

    That blog helps. thanks. 
  10. Lisitsa
    Lisitsa avatar
    15 posts
    Member since:
    Apr 2014

    Posted 04 Oct Link to this post

    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!

  11. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 07 Oct Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready