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

Gridview Row Count after filtering

7 Answers 786 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dameion Bryan
Top achievements
Rank 1
Dameion Bryan asked on 25 Jun 2010, 01:54 AM
How do I determine the number of rows in a RadGridView after the items have been filtered.

On my view I have the following binding code on a textblock, which does get the count of the rows that are loaded into the grid, but the rowcount is not updated when the grid is filtered.

Text

 

 

="{Binding ElementName=StoreMaintenanceGridView, Path=Items.Count, Mode=OneWay}"

 


I have seen in the asp grid control where there is a "MasterTableView" object associated with the GridView that allows you to retreive this information, yet that isn't available in Silverlight.

Thanks in Advance.

7 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 25 Jun 2010, 09:58 AM
Hi Dameion Bryan,

Currently the Items collection does not raise PropertyChanged events for its Count property.

You can workaround the current limitation by updating the text manually:

public MainPage()
{
    InitializeComponent();
  
    this.clubsGrid.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
}
  
void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
    this.countText.Text = this.clubsGrid.Items.Count.ToString();
}


Sincerely yours,
Milan
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
Jani
Top achievements
Rank 1
answered on 15 Apr 2011, 02:37 PM
This Issue is still open.
The suggested workaround is not applicable in our MVVM solution.
0
Rossen Hristov
Telerik team
answered on 18 Apr 2011, 11:50 AM
Hello Jani,

The issue has been resolved. RadGridView.Items will raise PropertyChanged for the Count property.

You can give it a try with one of the latest versions, for example 2011 Q1.

Regards,
Ross
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
Adhi
Top achievements
Rank 1
answered on 21 Nov 2014, 07:22 PM
Hi - Could you please post the implementation of filter count? Please include Xaml code and event to handle.


Thank you very much !!!
1
Dimitrina
Telerik team
answered on 24 Nov 2014, 12:23 PM
Hello,

We improved this functionality and now you can get the correct items count by directly binding to the Count property of RadGridView's Items collection.
For example:
<TextBlock Text="{Binding ElementName=clubsGrid, Path=Items.Count, Mode=OneWay}"/>

Would you please try with our latest version and let me know the result?

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Александр
Top achievements
Rank 1
answered on 27 Jul 2017, 07:54 AM

Dimitrina, could you please describe why those binding works correct only after filter applied. My situation is:

I bound textblock for Items.Count property but it doesn't show count on first grid initialization only. I found a workaround - I set DataLoadMoad="Asynchronous", but AIK telerik not recommend to use this mode

0
Dilyan Traykov
Telerik team
answered on 31 Jul 2017, 02:07 PM
Hello Alexandr,

I'm attaching a sample project where the Items.Count property contains the correct value upon the initialization of the RadGridView control with the default DataLoadMoad. Could you please have a look and let me know how this project differs from the one you have at your end?

If possible, please open a new support ticket and send over a sample project demonstrating your issue so that I can further assist you.

I'm looking forward to your reply.

Regards,
Dilyan Traykov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Dameion Bryan
Top achievements
Rank 1
Answers by
Milan
Telerik team
Jani
Top achievements
Rank 1
Rossen Hristov
Telerik team
Adhi
Top achievements
Rank 1
Dimitrina
Telerik team
Александр
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or