New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Migrating from RadComboBox Classic to ASP.NET AJAX version

RadComboBox for ASP.NET AJAX has changed because of evolving to the ASP.NET Ajax framework and Telerik.Web.UI suite. All of the client-side properties and methods' names have changed along with several server API changes. Some properties and methods have been completely removed, while new ones have been added.The control's client-side API is not backward-compatible with RadComboBox Classic version. All the changes included in the AJAX RadComboBox's client-side API are listed below:

Client-side API Changes

RadComboBox class

The tlrkComboBoxes array has been removed. The Telerik.Web.UI.RadComboBox.ComboBoxes should be used instead. For more details please refer to the Client-Side Basics article.

 

RadComboBox ClassicRadComboBox AJAX
Methods
HideDropDownhideDropDown
ToggleDropDowntoggleDropDown
ShowDropDownshowDropDown
Disabledisable
Enableenable
FindItemByValuefindItemByValue
FindItemByTextfindItemByText
GetText / SetTextget_text / set_text
GetValue / SetValueget_value / set_value
RequestItemsrequestItems
ClearItemsclearItems
ClearSelectionclearSelection
ClientDataStringThe ClientDataString property has been removed. The OnClientItemsRequesting event's event arguments should be used instead:
ASPNET
	     
function OnClientItemsRequesting(sender, eventArgs)
{    
    //get the context object    
    var context = eventArgs.get_context();    
    //set a value to the context object    
    context["FilterString"] = eventArgs.get_text();  
}
				

Then, you can access the context object in the WebService method:

C#
	     
IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
string txt = contextDictionary["FilterString"].ToStrring();
				

You can also access the context object in the ItemsRequested event handler using the event arguments:

C#
	     
protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{    
    string txt = e.Context["FilterString"].ToString();
}
				
RadComboBox ClassicRadComboBox AJAX
Properties
MoreResultsBoxIDget_moreResultsBoxElement()- returns the DOM element of the MoreResultsBox.
MoreResultsMessageBoxIDget_moreResultsBoxMessageElement() - returns the DOM element of the MoreResultsBox element.
DropDownVisibleget_DropDownVisible()
ImageIDget_imageDomElement() - returns the DOM element of the drop arrow image.
InputIDget_inputDomElement() - returns the DOM element of the input field.
DropDownIDget_dropDownElement()- returns the DOM element of the drop-down area.
Itemsget_items() - returns an Items collection.
Enabledget_enabled() - returns true if the combobox is enabled, false otherwise. set_enabled(true) - enables the RadComboBox, set_enabled(false) - disables the RadComboBox.
SelectedItemget_selectedItem() / set_selectedItem(item)
HighlightedItemget_highlightedItem() / set_highlightedItem(item)

RadComboBoxItem class

 

RadComboBoxItem ClassicRadComboBoxItem AJAX
Methods
Highlighthighlight
UnHighlightunHighlight
Disabledisable
Enableenable
Selectselect
SetAttributesetAttribute
Properties
Enabledget_enabled() - returns true if the item is enabled, false otherwise. set_enabled(true) - enables an item, set_enabled(false) - disables an item.
Indexget_index()
ComboBoxget_combobox()
Textget_text() / set_text(string)
Valueget_value() / set_value(string)

RadComboBoxItemCollection class (new)

MemberNotes
Methods
addAdds an item
insertInserts an item
removeRemoves an item
clearClears the items
getItemGets an item from the Items collection.
indexOfReturns the index of an item.
removeAtRemoves an item at a specified index.
get_countReturns the count of the items.
trackChangesIndicates the beginning of client-side changes that are meant to be persisted on the server.
commitChangesIndicates the end of client-side changes that are meant to be persisted on the server.

Server-side API changes

RadComboBox class

 

RadComboBox ClassicNotes
Properties
ContentFileRemoved: The LoadContentFile method should be used instead.
ExternalCallbackPageRemoved: An external streamer page is no longer needed. The items' population of the RadComboBox should be done via WebService instead.
IsCallBackRemoved: The Page.IsCallBack property should be used instead.
ValueRemoved: With the new RadComboBox for ASP.NET AJAX , the SelectedValue property is persisted on the server even when the items are loaded on demand. Therefore, the Value property is no longer needed.
RadComboBoxItemsRequestedEventArgs.ClientDataStringRemoved: The RadComboBoxItemsRequestedEventArgs.Context property should be used instead. It returns an object of type IDictionary .
AfterClientCallBackErrorChanged to OnClientItemsRequestFailed.
Methods
GetXmlStringChanged to GetXml (inherited from ControlItemContainer class).
LoadXmlStringChanged to LoadXml (inherited from ControlItemContainer class).