Contents
New to Telerik RadComboBox?
Already using the control
Licensing
Installation and deployment
Standards Compliance
AJAX Support
ASP.NET 2.0 Features
Design Time Support
Defining RadComboBox Structure
Data binding
Controlling the visual appearance
Templates
Custom Attributes
Load On Demand Support
RadComboBox Client-Side
RadComboBox Server-Side
Example Scenarios (How to)
TroubleShooting
API Reference
|
|
| The RadComboBox client object model |
Send comments on this topic. |
| See Also |
|
|
RadComboBox Client-Side > The RadComboBox client object model |
Methods
|
Name |
Parameters |
Return Type |
Description |
|
SetText |
(string text) |
none |
Sets the text of the input field of Telerik RadComboBox to the value of the parameter of the function.
Example:
| |
Copy Code |
|
<script language="javascript" type="text/javascript"> function SetTextOfTheComboBox() { var combo = <%=RadComboBox1.ClientID %>; combo.SetText("CustomText"); } </script> <rad:RadComboBox ID="RadComboBox1" runat="server"> </rad:RadComboBox> | |
|
GetText |
none |
(string text) |
Gets the text of the input filed of Telerik RadComboBox. |
| SetValue |
(string text) |
none |
Set the value of the combobox. |
| GetValue |
none |
(string text) |
Gets the value of the combobox. |
| ShowDropDown |
none |
none |
Opens the drop-down area of Telerik RadComboBox. |
| HideDropDown |
none |
none |
Closes the drop-down area of Telerik RadComboBox. |
| ToggleDropDown |
none |
none |
Toggles the drop-down area of Telerik RadComboBox. |
| Enable |
none |
none |
Enables Telerik RadComboBox. |
| Disable |
none |
none |
Disables Telerik RadComboBox. |
| FindItemByValue |
(string value) |
RadComboBoxItem |
Returns the first RadComboBoxItem object whose Value property is equal to the passed parameter. |
| FindItemByText |
(string text) |
RadComboBoxItem |
Returns the first RadComboBoxItem object whose Text property is equal to the passed parameter. |
| ClearItems |
none |
none |
Clears all items of the combobox. |
| ClearSelection |
none |
none |
Clears the selection:
| |
Copy Code |
|
<script> function ClearSelection() { var combo = <%=RadComboBox1.ClientID %>; combo.ClearSelection(); } </script> | |
| RequestItems |
(string text, Boolean) |
none |
Initiates a callback request (ItemsRequested server event is fired) with the specified text. The second bool parameter instructs the combo to append the new items (true) or clear items (false).
Example:
| |
Copy Code |
|
//aspx <script language="javascript" type="text/javascript"> function AddItems() { var combo = <%=RadComboBox1.ClientID %>; combo.RequestItems("Item1", true); } </script> <rad:RadComboBox ID="RadComboBox1" runat="server" OnItemsRequested="RadComboBox1_ItemsRequested"> </rad:RadComboBox> <input id="Button1" type="button" value="button" onclick="AddItems()" />
//codebehind protected void RadComboBox1_ItemsRequested(object o, Telerik.WebControls.RadComboBoxItemsRequestedEventArgs e) { //e.Text returns the value of the text parameter set on the client-side RadComboBox1.Items.Add(new RadComboBoxItem(e.Text)); } | |
Properties
|
Name |
Type |
Description |
ID (Read Only) |
String |
Gets the server-side ID of Telerik RadComboBox. |
ClientID (Read Only) |
String |
Gets the ClientID of Telerik RadComboBox. |
DropDownID (Read Only) |
String |
Gets the ClientID of the drop-down part of Telerik RadComboBox. |
InputID (Read Only) |
String |
Gets the ClientID of the input field of Telerik RadComboBox. |
ImageID (Read Only) |
String |
Gets the ClientID of the image element (drop-arrow) of Telerik RadComboBox.
Example:
| |
Copy Code |
|
<script language="javascript" type="text/javascript"> function ChangeImageElement() { var combo = <%=RadComboBox1.ClientID %>; var image = document.getElementById(combo.ImageID); image.src = "MyImage.gif"; } </script> | |
MoreResultsBoxID (Read Only) |
String |
Gets the ClientID of the MoreResultsBox image element of Telerik RadComboBox. |
MoreResultsBoxMessageID (Read Only) |
String |
Gets the ClientID of the MoreResultsBox Message element of Telerik RadComboBox. |
DropDownVisible (Read Only) |
Boolean |
True if the dropdown has been opened. |
ItemRequestTimeout (Read Only) |
int |
The delay in ms before items are requested. |
AutoPostback (Read Only) |
Boolean |
True if AutoPostBack is enabled. |
Enabled (Read Only) |
Boolean |
True if Telerik RadComboBox is enabled. |
SelectedItem (Read Only) |
RadComboBoxItem |
Gets the currently selected item. |
SelectedIndex (Read Only) |
int |
Gets the index of the currently selected item. |
Items (Read Only) |
Collection |
Gets a javascript array containing all RadComboBoxItem client instances.
Example:
| |
Copy Code |
|
//select the second item var combo = <%=RadComboBox1.ClientID %>; combo.Items[1].Select() | |
See Also
|