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

RadDataPager: Sorting with OData

5 Answers 201 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Florian
Top achievements
Rank 1
Florian asked on 18 Jan 2012, 05:50 PM
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

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 19 Jan 2012, 09:24 AM
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 >>

0
Florian
Top achievements
Rank 1
answered on 19 Jan 2012, 12:18 PM
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?


0
Rossen Hristov
Telerik team
answered on 19 Jan 2012, 12:32 PM
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 >>

0
Florian
Top achievements
Rank 1
answered on 19 Jan 2012, 04:24 PM
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.
0
Florian
Top achievements
Rank 1
answered on 20 Jan 2012, 11:08 AM
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.


Tags
DataPager
Asked by
Florian
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Florian
Top achievements
Rank 1
Share this question
or