QueryableDataServiceCollectionView Distinct not Supported

5 posts, 0 answers
  1. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 10 Jan 2013 Link to this post

    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... 
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Jan 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Jan 2013 Link to this post

    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.

  5. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 11 Jan 2013 Link to this post

    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.
  6. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 11 Jan 2013 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready