OData binding and Sorting

4 posts, 0 answers
  1. David Christensen
    David Christensen avatar
    2 posts
    Member since:
    Jun 2012

    Posted 23 Mar 2012 Link to this post

    Is there a way using OData binding to sort the results or to limit the columns to only the data value and data text fields?

    <telerik:RadComboBox ID="cmbApplication" runat="server" EnableLoadOnDemand="true">
        <WebServiceSettings Path="http://localhost:26022/DataService.svc/">
                <ODataSettings ResponseType="JSONP">
                        <Entities>
                                <telerik:ODataEntityType Name="Application" DataValueField="ApplicationID" DataTextField="AppName" />
                         </Entities>
                          <EntityContainer>
                                  <telerik:ODataEntitySet EntityType="Application" Name="Application" />
                          </EntityContainer>
                   </ODataSettings>
         </WebServiceSettings>
    </telerik:RadComboBox>
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 27 Mar 2012 Link to this post

    Hi,

    Currently the build-in OData binding mechanism of the RadComboBox doesn't provide sorting functionality. As for your second query could you be more specific on what exactly do you mean by: limit the columns to only the data value and data text fields?

    In general when you query an OData service a set of entities are being returned and you bind your control to specific fields of these entities.

    All the best,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. David Christensen
    David Christensen avatar
    2 posts
    Member since:
    Jun 2012

    Posted 27 Mar 2012 Link to this post

    Let's say I have an entity with multiple properties. I want to bind my combobox to a set of those entities, but I'm only interested in the ID and Name properties. If I pull the entity with all it's properites, that is a lot more data than I need.

        http://services.odata.org/OData/OData.svc/Products?$format=json

        4.59KB    

    I think it would be useful to specify which properties I wanted to be included in the response.

        http://services.odata.org/OData/OData.svc/Products?$format=json&$select=ID,Name

        1.33KB   
  4. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 30 Mar 2012 Link to this post

    Hi,

    You are right that it's better from performance point of view to query only particular fields and I shall forward this request to our development team.

    All the best,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top