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

RadAutoCompleteBox Object

This article explains about the properties and methods of the RadAutoCompleteBox client-side object. The RadAutoCompleteBox client API allows for complete control over the client object, giving the developer the opportunity to set the behavior of the control depending on the scenario.

NameParametersReturn TypeDescription
get_text()nonestringReturns a string containing the text of each entry, separated by a delimeter.
get_entries()noneTelerik.Web.UI.AutoCompleteBoxEntryCollectionReturns a collection of all the entries. See Example 1.
get_inputElement()noneDOM ObjectGets a reference to the HTML element representing the input area.
get_isUsingODataSource()nonebooleanReturns true if RadAutoCompleteBox is bound to OData, false otherwise.
get_bindingMode()noneTelerik.Web.UI.RadAutoCompleteBoxBinding EnumReturns a number from the RadAutoCompleteBoxBinding enumeration. See Example 2.
get_allowCustomEntry()nonebooleanReturns true if RadAutoCompleteBox creating entries which text does not match any of the items present in the drop-down container is allowed, false otherwise.
get_maxResultCount()noneintGets how many results the RadAutoCompleteBox is allowed to be populated with
get_minFilterLength()noneintGets the minimum length of the typed text before the control initiates a request for its DataSource.
get_delimiter()nonestringGets the character that is used to separate the entries.
set_allowCustomEntry()booleannoneEnables/disables creation of entries which text does not match any of the items present in the drop-down container.
set_maxResultCount()intnoneSets how many results will the RadAutoCompleteBox be populated with.
set_minFilterLength()intnoneSets the minimum length of the typed text before the control initiates a request for its DataSource.
set_delimiter()stringnoneSets the character that is used to separate the entries.
set_requestDelay()number (milliseconds)undefinedSets delay time in milliseconds, when a request to the datasource is being triggered. See Example 3.
clear()nonenoneCloses the drop-down container, deleting all the items present in it.
createEntry()string,stringTelerik.Web.UI.AutoCompleteBoxEntryReturns the created entry. See Example 1.
query()stringnoneSends request to the server against the value passed as an argument. If no argument is passed, the request is made against the text currently present into the input area.

Example 1: Access the RadAutoCompleteBox entries collection, and add new entry:

JavaScript
	
	function addEntry() {
		var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
		var newEntry = autoComplete.createEntry('Text', 'Value');
		var entries = autoComplete.get_entries();
		entries.add(newEntry);
    }
	

Example 2: Telerik.Web.UI.RadAutoCompleteBoxBinding Enumeration:

ASPNET
RadAutoCompleteBoxBinding:
{
	Callback: 0,
	WebService: 1,
	OData: 2
}

Example 3: Set delay of 5 seconds when requesting data form the datasource:

JavaScript
	
	function delayRequest() {
		var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
		autoComplete.set_requestDelay(5000);
    }
	

See Also

In this article
See Also
Not finding the help you need?
Contact Support