RadComboBox for ASP.NET AJAX

RadControls for ASP.NET AJAX

The EmptyMessage property can be used when the AllowCustomText property is set to True (it is always true in a Load-on-Demand scenario). It sets a text in the input field of the combobox. This text disappears when the combobox gets the focus and appears again on blur if no item is selected.

Setting the EmptyMessage server-side

Setting the EmptyMessage client-side

CopyJavaScript
function onClientLoadHandler(sender, eventArgs) {

    sender.set_emptyMessage("Please select a country");
}


Additionally, you can get the EmptyMessage property client-side by calling the get_emptyMessage() method of the combobox.

Controlling the appearance of the EmptyMessage text

To control the appearance of the EmptyMessage text you can change this CSS rule:

CopyCSS
.RadComboBox_Default .rcbInputCell .rcbEmptyMessage 
{ 
    color: #666; font-style: italic;
}

Here Default is the name of the Skin of the combobox.