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

DataFilter + DataPager

2 Answers 84 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Alex Peachey
Top achievements
Rank 1
Alex Peachey asked on 23 Aug 2010, 08:33 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 24 Aug 2010, 08:00 AM
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
0
Alex Peachey
Top achievements
Rank 1
answered on 24 Aug 2010, 04:04 PM
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.
Tags
DataFilter
Asked by
Alex Peachey
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Alex Peachey
Top achievements
Rank 1
Share this question
or