Problem with RadDataPager, RadGridview, PagedCollectionView and filters

4 posts, 0 answers
  1. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 31 Aug 2015 Link to this post

    Good morning,

    I have some problems with this combination,

    The RadGridView has filtering. The itemsource of RadGridView and RadDataPager is a PagedCollectionView list.

    When no filter is applied I get X pages, and I see ​20 items on Page 1. When I apply a certain filter in the RadGridView, I now see 5 items on Page 1, and the RadDataPager still tells me there are X pages. In addition, per page, I'm see seeing only the filters of current page and not all collection.

    It doesn't happen when the collection is a ObservableCollection for example.I have some problems with this combination,

    The RadGridView have enable the filtering.

    The itemsource of RadGridView and RadDataPager is a PagedCollectionView list.

    When no filter is applied I get X pages, and I see ​20 items on Page 1. When I apply a certain filter in the RadGridView, I now see 5 items on Page 1, and the RadDataPager still tells me there are X pages. In addition, per page, I'm see seeing only the filters and not all collection of filter.

    It doesn't happen when the collection is a ObservableCollection for example.

     

  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 03 Sep 2015 Link to this post

    Hello Leonard,

    Internally, RadGridView uses a queryable collection as the data operations are implemented through LINQ. Regardless of the type of collection you pass to the control, if it doesn't already implement IQuaryable, it will be wrapped internally.

    In a gist, when using PagedCollectionView, the filtering is applied after the paging of the collection, imagine it working with the subset of data on the current page. In the case of ObservableCollection, the logic that translates it to a QuaryableCollectionView will first filter the data, and then page it, hence the difference in the result. The behavior is simply an implementation detail of the control.

    I hope this makes things clear.

    Regards,
    Petya
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 03 Sep 2015 in reply to Petya Link to this post

    Hi Peyia and thanks for your answer.

    I'm still wondering, Is there a way to get the desired behavior using RadGridView with PagedCollectionView and Filters?

     

  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 08 Sep 2015 Link to this post

    Hi Leonard,

    It is possible to change the filtering control, so you might be able to show all distinct values in it, but the filtering itself will still work with the items of the current page only. I'm afraid I cannot suggest anything that will make this work as desired.

    Regards,
    Petya
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top