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
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
The suggested workaround is not applicable in our MVVM solution.
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.
Ross
the Telerik team
Thank you very much !!!
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.
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
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