The value for OData $orderby cannot be empty

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

    Posted 06 Jun 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
    1101 posts

    Posted 09 Jun 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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top