DataFilter + DataPager

3 posts, 1 answers
  1. Alex Peachey
    Alex Peachey avatar
    56 posts
    Member since:
    May 2006

    Posted 23 Aug 2010 Link to this post

    I have a very large dataset I'd like to use DataFilter for. I currently have a DataFilter, a DataPager, and a GridView set up with the DataPager source set to the FilteredSource and the GridView ItemsSource set to the PagedSource. For reference I've also tried it the other way where I've tied the GridView to the FilteredSource and the Source for the DataPager to the GridView Items.

    Both ways work as far as filtering and paging the data.

    The problem arises when I want to know what the filtered data set is. I want to display a count to the user of how many items are currently in the set and when they are done filtering I need to grab all of the filtered items and do something with them.

    I've found if I access the FilteredSource and get a count, I only have 10 items (which is my page size). So it seems no matter when I try to get to the filtered set of items I only get the current page.

    How can I get access to both a current count and the full set of items in this scenario?
  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 24 Aug 2010 Link to this post

    Hi Alex Peachey,

    You can get the filtered source by 3 different ways in this case:

    1. Using RadDataFilter:
    (dataFilter.FilteredSource as Telerik.Windows.Data.DataItemCollection).ItemCount

    2. Using RadDataPager:
    dataPager.PagedSource.ItemCount

    3. Using RadGridView:
    gridView.Items.ItemCount

    Hope this helps. Let me know if you have any additional questions.

    Greetings,
    Veselin Vasilev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alex Peachey
    Alex Peachey avatar
    56 posts
    Member since:
    May 2006

    Posted 24 Aug 2010 Link to this post

    Thanks, this is what I needed:
    (dataFilter.FilteredSource as Telerik.Windows.Data.DataItemCollection).ItemCount

    I had been using FilteredSource as an IEnumerable and casting to an object list and accessing Count. This would always limit to the page size no matter which element I did it from.

    The trick I see is to use ItemCount.
Back to Top