As others I had to sort before the RadDataPager paging takes action so I solved like this:
Is that ok?
- I created the MyNorthwindContext like in the documentation
- Then I added a property with my sort, something like
public
class
MyNorthwindContext : NorthwindEntities
{
public
MyNorthwindContext() :
base
(
new
Uri(
"http://services.odata.org/Northwind/Northwind.svc"
, UriKind.Absolute)){}
public
DataServiceQuery<Category> SortedCategories
{
get
{
if
((
this
._SortedCategories ==
null
))
{
this
._SortedCategories =
base
.CreateQuery<Category>(
"Categories"
)
.AddQueryOption(
"$orderby"
,
"CategoryID desc"
);
}
return
this
._SortedCategories;
}
}
private
DataServiceQuery<Category> _SortedCategories;
}
- so
<
telerik:RadDataServiceDataSource
Name
=
"categoriesDataSource"
QueryName
=
"SortedCategories"
AutoLoad
=
"True"
>
Is that ok?