Telerik RadComboBox version 2.5.3+
You can simply set the Text property of the RadComboBox class either in the aspx combobox definition or in the codebehind, like:
| ASPX |
Copy Code |
|
<rad:RadComboBox id="RadComboBox1" runat="server" AllowCustomText="True" Text="Select an Item"/> |
CodeBehind:
| C# |
Copy Code |
|
RadComboBox1.Text = "Select an Item"; |
Also, you should keep into account that the AllowCustomText property should be enabled.
Telerik RadComboBox version 2.5.2
To set default text to the input field of the combobox, you can use the following approach.
Example:
| ASPX |
Copy Code |
|
<body onload="SetText()"> <form id="form1" runat="server"> <script language="javascript" type="text/javascript"> function SetText() { var combo = <%=RadComboBox1.ClientID %>; combo.SetText("DefaultText"); } </script> <rad:RadComboBox ID="RadComboBox1" runat="server"> </rad:RadComboBox> </form> </body> |
The result of the above code will be:
