New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Ensure the Selection of Existing Items with AllowCustomText

Often, you need to allow users to type in RadComboBox, but you want to be sure that the user selects one of the existing items from the dropdown. Here are a few ways to accomplish this:

  • Set the MarkFirstMatch property to True and AllowCustomText property to False.

In load-on-demand scenario the user will be able to type anything into the input area and if no item matches - the input area will be reset to blank.In non load-on-demand scenario the user will be able to type only letters that match text of the items.

  • Subscribe to the OnClientBlur client-side event and define its handler as follows:

function OnClientBlurHandler(sender, eventArgs) {
    var textInTheCombo = sender.get_text();
    var item = sender.findItemByText(textInTheCombo);
    //if there is no item with that text
    if (!item) {
        setTimeout(function () {
            var inputElement = sender.get_inputDomElement();
   = "red";
        }, 20);

In this article