RadDataPager: Sorting with OData

6 posts, 0 answers
  1. Florian
    Florian avatar
    9 posts
    Member since:
    Jul 2010

    Posted 18 Jan 2012 Link to this post

    Hallo,

    I've bound an OData service via RadDataServiceDataSource to a RadGridView and a RadDataPager.

    Unfortunately the sorting does not work across pages. I've traced trace the server side an found that the orderby property is not set on the query.

    The connection is very simple:

    <telerik:RadDataServiceDataSource x:Name="_partnerSource" AutoLoad="True" QueryName="AllPartners" />


    <
    telerik:RadDataPager Name="_pager" 
                               

    Source="{Binding DataView, ElementName=_partnerSource}" IsEnabled="True" PageSize="10"/>


    <
    telerik:RadGridView Name="gridPartner"
    AutoGenerateColumns="False" DataLoadMode="Synchronous" IsFilteringAllowed="True" ItemsSource="{Binding DataView, ElementName=_partnerSource}">

    The DataServiceQuery<PartnerInfo> AllPartners is take from the Service Reference


    What may be missing or wrong?

    Greetings Florian
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 19 Jan 2012 Link to this post

    Hi,

    Unfortunately, we could not reproduce this on our online demos. Sorting works as expected in the online demos. You can even see the query string in the debug text-box on the bottom of the screen. When you sort a given column, you can clearly see the OrderBy clause being appended to the URI. Please, check the demos out.

    Furthermore, I have attached a sample project that demonstrates that sorting works correctly indeed. You can take a look at it. Please, run the sample project and examine how sorting works. The solution has to starting project -- the server and the client, so make sure both of them are running. When you run the project you will have two windows -- one will be a Console window that shows what happens on the server and what requests are received and the other one is the client windows in which you can also see what URI's are requested in the bottom part of the window. Run the project and examine how sorting RadGridView on one of its columns appends an OrderBy clause.

    Now, if you can send us a sample project that demonstrates how sorting does not work for you, we will take a look at it. Alternatively, you can take my sample project and modify it so that it demonstrates how sorting does not work.

    We need something that reproduces your problem that we can run and debug.

    We are looking forward to hearing from you.

    All the best,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Florian
    Florian avatar
    9 posts
    Member since:
    Jul 2010

    Posted 19 Jan 2012 Link to this post

    Tanks for your answer.

    I've connected your sample client to my OData service and the sorting works fine.

    A click on a column header should start a new query and trigger the LoadingData event.
    That is not the case in my project. And the querys does not contain an orderby.But sorting within the page does work.
    I can't see why. All the properties on the DataServiceDataSource, the RadGridView and the GridViewDataColumns seem to be the same as in your sample.

    Any hint?


  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 19 Jan 2012 Link to this post

    Hello,

    Unfortunately we cannot guess why this could happen in your real project. There must be something different, but we don't know what it is.

    Greetings,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Florian
    Florian avatar
    9 posts
    Member since:
    Jul 2010

    Posted 19 Jan 2012 Link to this post

    I've put your sample in my project and the soritng does not work anymore.

    May it be an already solved problem?

    We use version is 2011.3.1220.40. I cannot replace the controls on the fly with the ones from the sample.

    I have no more idea why RadDataServiceDataSource does not sort.
  7. Florian
    Florian avatar
    9 posts
    Member since:
    Jul 2010

    Posted 20 Jan 2012 Link to this post

    I was mistaken about our version, we are using 2011.2.712.40.
    In your change history you mention "Fixed: Sorting descriptors problem."

    I've replaced your control dlls with the ones we use. And the sorting does not work.

    A hint about an already fixed bug would have saved me a lot of work.


Back to Top
UI for WPF is Visual Studio 2017 Ready