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

The value for OData $orderby cannot be empty

1 Answer 362 Views
ODataDataSource
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Veteran
Richard asked on 06 Jun 2016, 06:12 PM

Trying to use an ODataDataSource with a RadSearchBox.  When I try to use it, I get the following error:

The query specified in the URI is not valid. The value for OData query '$orderby' cannot be empty.

Is there a way to set an orderby that I can pass?  I don't see an option (or maybe I'm going nuts - could be) and it appears as though the ODataDataSource is just passing a blank $orderby= in the query string. 

Thanks,

Richard

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 09 Jun 2016, 07:42 AM
Hello,

The provided information is not enough th troubleshoot the issue. Our online demos demonstrate a working scenario with the SearchBox bound to an ODataDataSource:
http://demos.telerik.com/aspnet-ajax/searchbox/examples/populatingwithdata/defaultcs.aspx

I've also tested the following markup which is working on my end:
<telerik:RadODataDataSource runat="server" ID="DataSource1">
    <Transport>
        <Read Url="http://demos.kendoui.com/service/Northwind.svc/"></Read>
    </Transport>
    <Schema>
        <telerik:DataModel ModelID="Product" Set="Products">
            <telerik:DataModelField FieldName="ProductID" />
            <telerik:DataModelField FieldName="ProductName" />
        </telerik:DataModel>
    </Schema>
</telerik:RadODataDataSource>
<telerik:RadSearchBox RenderMode="Lightweight" runat="server" ID="RadSearchBox1"
    ODataDataSourceID="DataSource1"
    DataModelID="Product"
    DataKeyNames="ProductID, ProductName"
    DataValueField="ProductID"
    DataTextField="ProductName">
    <DropDownSettings Height="400" Width="300" />
</telerik:RadSearchBox>

Regards,
Bozhidar
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ODataDataSource
Asked by
Richard
Top achievements
Rank 1
Veteran
Answers by
Bozhidar
Telerik team
Share this question
or