This example shows how to dynamically add and filter items upon typing text in the input field of the combobox.
This is an alternative of the Load On Demand mechanism, however, this mechanism uses a WebService instead.
The path to the web service and the name of the service method are specified in
the WebServiceSettings' Path and Method properties.
We hooked on the OnClientItemsRequesting event and passed the text
of the input field to the WebService so that the items can be filtered:
function itemRequesting(sender, eventArgs)
{
var context = eventArgs.get_context();
context["Filter"] = sender.get_text();
}
In order to use the integrated support, the web service should have the following signature:
[ScriptService]
public class WebServiceName : WebService
{
[WebMethod]
public RadComboBoxItemData[] WebServiceMethodName(object context)
{
// We cannot use a dictionary as a parameter, because it is only supported by script services.
// The context object should be cast to a dictionary at runtime.
IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
//...
}
}