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

Get the filtered collection from a QueryableCollectionView

4 Answers 416 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Giuseppe Marchi MVP
Top achievements
Rank 1
Giuseppe Marchi MVP asked on 26 Aug 2011, 12:53 PM
Hi all.
I'm using the QueryableCollectionView to filter mu RadChart. With this class i'm able to retrieve the original collection of data (using the SourceCollection property). But, how i can retrieve the filtered collection of data?
Thanks in advance

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 29 Aug 2011, 12:09 PM
Hi Giuseppe,

Since the QueryableCollectionView collection is the actual view as it name implies, it is the de facto filtered collection.

So for example, if you add a FilterDescriptor to filter the QueryableCollectionView collection, if you enumerate it it will contained only the items that pass the filter. That is why its name ends in *View.

I hope this makes sense.

Best wishes,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Sudhir
Top achievements
Rank 1
answered on 05 Feb 2014, 10:30 PM
No it doesn't make sense. Can you point to an example where I can use Filter property of QueryableCollectionView?
0
Dimitrina
Telerik team
answered on 10 Feb 2014, 02:55 PM
Hi, 

I am afraid setting Filter property for QueryableCollectionView is not currently supported. You should use the FilterDescriptors collection instead. 

For example you can add a FilterDescriptor like so:
queryableView.FilterDescriptors.Add(new FilterDescriptor("Country", FilterOperator.IsEqualTo, "England"));

I hope this helps.

Regards,
Didie
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
George
Top achievements
Rank 1
Iron
answered on 25 Nov 2021, 03:17 AM

You can use Cast extensions to get the filtered result:

QueryableCollectionView.Cast<T>()

Tags
General Discussions
Asked by
Giuseppe Marchi MVP
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Sudhir
Top achievements
Rank 1
Dimitrina
Telerik team
George
Top achievements
Rank 1
Iron
Share this question
or