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

QueryableDataServiceCollectionView Distinct not Supported

4 Answers 59 Views
DataServiceDataSource
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 11 Jan 2013, 04:58 AM
I have a QueryableDataServiceCollectionView bound to a RadGridView and RadDataPager. Working good so far. Except, when I try to pop down the filtering menu, I get a Distinct is not supported error from WCF Data Services. Which makes a lot of sense. WCF Data Services doesn't support Distinct.

So why are you guys trying to use Distinct? The control should be smart enough to know that it's not supported, and do it some other way... 

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 11 Jan 2013, 08:22 AM
Hi,

We will try think of a way to detect whether the query provider of the source IQueryable (DataServiceQueryProvider in this particular case) supports the Distinct operation. If it does not, we can return the distinct values which are currently in memory, i.e. if you have paging the distinct values of the current page which is on the client.

Until we find a solution, you can simply turn off ShowDistinctFilters on the column, which should eliminate the distinct request to the server. Let us know whether this is a viable workaround for the time being.

By the way, if you have an external way of bringing distinct values to the client, you can attach to the DistinctValuesLoading event of the grid and supply your own list by assigning it to e.ItemsSource thus bypassing our default implementation.

Regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rossen Hristov
Telerik team
answered on 11 Jan 2013, 09:24 AM
Hi,

Interesting. It seems that our developers have already handled this case.

I just tested the scenario that you have described and I do not get the exception that you mention. I have attached a sample project to show that.  Can you please check it out.

Can you please modify my sample project so that when I open the FilteringControl I will get the exception that you mention. What do you do in order to get such an exception in your project?

Looking forward to hearing from you.

Kind regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jerome
Top achievements
Rank 1
answered on 11 Jan 2013, 07:49 PM
Ahh. What version? I'm running 2012.3.1129.45. The latest that appears available.


So I tried to turn ShowDistinctFilters off on the column... but I still get the error when I click the drop down.
0
Jerome
Top achievements
Rank 1
answered on 11 Jan 2013, 08:05 PM
I think I just solved it. I think something something was wrapping the QueryableDataServiceCollectionView in another IQueryable or something, and WCF Data Services was handling that properly (by recording the expression tree at the right place), but the Telerik controls didn't know it was actually a Data Services collection, and so they actually invoked Distinct on it. Seems to work now. Sorry to bug you.
Tags
DataServiceDataSource
Asked by
Jerome
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jerome
Top achievements
Rank 1
Share this question
or