Unfortunately I'm currently using an old version of the GridView (Q1 2009) and I'm having trouble trying to get the filter count. I bind the ItemsSource to the results of my web service (which returns an ObservableCollection) but when I filter the grid I don't seem able to determine the filtered result count. The Items collection always has a count of 0 and the ItemsSource the length of the collection returned. I've seen in previous forum posts that I should catch the collectionchanged event of the Items property but this doesn't seem relevant as the Items is empty. Am I missing something obvious here please??
Thanks
Keith
6 Answers, 1 is accepted
RadGridView.Items.TotalItemCount will give you the total item count (count before filtering) and RadGridView.Items.Count will give you the number of currently displayed items. TotalItemCount - Count will give you the number of items that are not displayed.
Greetings,
Milan
the Telerik team
Thanks for the reply but I cannot see the property TotalItemCount. Is this available with the version I'm using (Q1 2009)? The Items.Count always seems to be 0 when I bind using the ItemsSource property.
Thanks
Keith
Sorry for the misunderstanding but the ticket information dictates that you are using 2010.2 812. Those properties were introduced after Q1 2009. Is it convenient for you to upgrade to our latest version?
Sincerely yours,
Milan
the Telerik team
RadGridView.Items.TotalItemCount will give you the total item count (count before filtering) and RadGridView.Items.Count will give you the number of currently displayed items. TotalItemCount - Count will give you the number of items that are not displayed.
How can i access in this for loop all items?
For i As Integer = 0 To grtours.Items.TotalItemCount - 1 <- All Items Dim row As DataItemsQuery = DirectCast(grtours.Items(i), DataItemsQuery) <- Problem index out of bounds Next Thank you ...
Hello Ulrich Fiege,
If you would like to access all items you need to have access to the original collection that the grid is bound to. For example, you can cast ItemsSource of the grid to your collection type to access all items - unfortunately this approach is not applicable if you are using CollectionView as items source.
It would be great if you can shame more details about your scenario so that we can provide you with more concrete answer.
Sincerely yours,
Milan
the Telerik team
Hello Ulrich Fiege,
If you would like to access all items you need to have access to the original collection that the grid is bound to. For example, you can cast ItemsSource of the grid to your collection type to access all items - unfortunately this approach is not applicable if you are using CollectionView as items source.
It would be great if you can shame more details about your scenario so that we can provide you with more concrete answer.
Sincerely yours,
Milan
the Telerik team