This question is locked. New answers and comments are not allowed.
Hello,
I am trying to implement a status bar that shows number of total rows, as well as number of filtered rows when applying a filter to an ItemsSource.
Trouble I am having is that I do not know number of filtered rows when I am using a pager: Grid.Items.Count is just showing Pager.PageSize because that is how many records there are in the grid when paging.
Another problem I have is that I can never catch "Filtering" or "Filtered" event, maybe because I am doing filtering programmatically by setting FilterDescription manualy..
How can I find out what is the number of filtered rows?
7 Answers, 1 is accepted
0
Hello boris,
Maya
the Telerik team
You need to use as a source QueryableCollectionView and its ItemCount to return the number of filtered items. Thus count of the shown items will be equal to all of them and not only to those on the current page. I am sending you a sample code so that you can test the proposed solution.
Maya
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
boris
Top achievements
Rank 1
answered on 28 Jun 2010, 10:31 AM
Hello Maya ,
Thank you for your answer.
However, my scenario is bit specific for the proposed solution. I am using a MVVM patern, and my grid is two-way bound to an ItemsSource in my model, but my model cannot be aware of the Telerik's QueryableCollectionView implementation, not to mention that I am using some dynamic data types with a custom DataTable implementation :S
0
Hi boris,
I am sending you the sample project so that you can use it as a reference.
Greetings,
Maya
the Telerik team
Another possible and applicable-in-every-case solution is to use Items.ItemCount and to bind the TextBlock to it. Items.ItemCount gets the number of known items in the view before paging is applied.
Thus your xaml file will be:
<
telerikGrid:RadDataPager
Name
=
"radDataPager"
Source
=
"{Binding Items, ElementName=radGridView}"
PageSize
=
"5"
IsTotalItemCountFixed
=
"True"
DisplayMode
=
"All"
/>
<
TextBlock
Grid.Row
=
"2"
Text
=
"{Binding Items.ItemCount, ElementName=radGridView}"
/>
I am sending you the sample project so that you can use it as a reference.
Greetings,
Maya
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
boris
Top achievements
Rank 1
answered on 02 Jul 2010, 09:14 AM
Hi Maya,
That is the property I needed :)
Tnx
0
Bryce
Top achievements
Rank 1
answered on 05 Apr 2012, 06:37 PM
Hi Maya,
This is also what I was looking for. However, I noticed if someone does a group by, the number will be changed to how many groups are created instead of still showing the number of total rows, or in this case the summation of all rows within the groups. I use the count aggregate to show how many rows are in each group already, and would like the textblock example you gave to still show the total number of rows.
Thanks,
Bryce
This is also what I was looking for. However, I noticed if someone does a group by, the number will be changed to how many groups are created instead of still showing the number of total rows, or in this case the summation of all rows within the groups. I use the count aggregate to show how many rows are in each group already, and would like the textblock example you gave to still show the total number of rows.
Thanks,
Bryce
0
Bryce
Top achievements
Rank 1
answered on 06 Apr 2012, 11:31 PM
0
Hi Bryce,
Maya
the Telerik team
I am glad that you found an appropriate solution for you scenario. Let us know in case you need further assistance.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>