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

Binding combo box to WCF call that returns json

1 Answer 147 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Corp Security
Top achievements
Rank 1
Corp Security asked on 02 Jun 2010, 12:46 AM
Hello,
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?

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 08 Jun 2010, 09:32 AM
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.)


Greetings,
Kalina
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.
Tags
ComboBox
Asked by
Corp Security
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or