The value for OData $orderby cannot be empty

2 posts, 0 answers
  1. Richard
    Richard avatar
    19 posts
    Member since:
    Sep 2011

    Posted 06 Jun 2016 Link to this post

    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

  2. Bozhidar
    Admin
    Bozhidar avatar
    1132 posts

    Posted 09 Jun 2016 Link to this post

    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.
Back to Top