Binding combo box to WCF call that returns json

2 posts, 0 answers
  1. Corp Security
    Corp Security avatar
    1 posts
    Member since:
    May 2010

    Posted 01 Jun 2010 Link to this post

    I have a WCF service that returns json data. I want to keep the web service generic enough to be called by other applications.

    However, on my website, when i call this service and bind to combo box, it fails. The combo box expects the return json to be RadComboBoxData. Is there a reason for this binding. It kind of defeats the purpose of web service.

    Can anyone explain if there is a more generic way of binding combo box to any json?
  2. Kalina
    Kalina avatar
    918 posts

    Posted 08 Jun 2010 Link to this post

    Hi Corp Security,

    The RadComboBoxData object contains properties that are necessary for the RadComboBox object to function:  text and value, number of items returned, EndOfItems property (used for paging), the context object, the RadComboBoxItemData collection and the message property.
    That is why it is necessary your WebMethod to return object of this type when you populate RadComboBox from WCF Web Service
         ( You can find more details about how to use WCF services with ASP.NET AJAX databound controls here.)

    Another option is to populate the RadComboBox via JQuery – you can call the webservice, create the RadComboBox items and populate the control client-side.
        ( You can find more details about RadComboBox client-side API here.)
        ( More details about loading JSON-encoded data from the server using a GET HTTP request
          you can find here.)

    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top