Paging - Load operation failed for query...


When you use RadDataPager or the standard DataPager you might encounter an error similar to this:

System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetOrder_Details_Extended'. The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.

Telerik Silverlight DataGrid troubleshoot paging

The Entity Framework can’t work with unsorted collections because the Skip() and Take() extension method expects an OrderBy clause.


Add an OrderBy clause in your query at server side or define a SortDescriptor in the DomainDataSource in XAML or in the code behind file.

public IQueryable<Order_Details_Extended> GetOrder_Details_Extendeds() 
    return this.ObjectContext.Order_Details_Extendeds.OrderBy(o => o.OrderID); 

<riaControls:DomainDataSource AutoLoad="True"  
                            d:DesignData="{d:DesignInstance my:Order_Details_Extended, CreateList=true}"  
                            QueryName="GetOrder_Details_ExtendedsQuery" Width="0"> 
        <my:NorthwindDomainContext /> 
        <riaControls:SortDescriptor PropertyPath="OrderID" /> 

order_Details_ExtendedDomainDataSource.SortDescriptors.Add(new SortDescriptor("OrderID", ListSortDirection.Ascending)); 

See Also

In this article
Not finding the help you need? Improve this article