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

[Solved] Can RadComboBoxContext be extented (WebService use) ?

1 Answer 96 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gmaps
Top achievements
Rank 1
Gmaps asked on 20 May 2009, 10:16 AM
Hello,

I have a situation where its usefull to add extra information to a webservice I'm calling with the RadCombobox.

Depending on the extra properties of an extended class of the RadComboBoxContext class I could do more within the WebMethod.

For example I want to add the contents of several controls into a List<string>. In the Webservice via the context I should be able to read this info out.




Can this be done? If yes, how can a pass the extended class to the Webservice?

With kind regards,

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 21 May 2009, 07:56 AM
Hello Gmaps,

The RadComboBoxContext we provide is actually inheriting from a Generic Dictionary. The purpose of the former is to establish a 'contract' between the RadComboBox and the WebService, so that in ShowMoreResults configurations the WebService supplies correct data.

In any other case, you could cast the context in the WebService to IDictionary and extract the needed values.

So, you could either inherit from RadComboBoxContext and implement your additional fields (to retain the ShowMoreResults support) or do not use a specified type at all.

In both cases, you could use the Context object at the client-side normally, without any extra code or modifications.

Please see the code for the Products.cs WebService, attached to this message, which illustrates the two approaches and let me know if you have any additional questions.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
ComboBox
Asked by
Gmaps
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or