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

The RadComboBox control supports the following features:

  • Databinding that allows the control to be populated from various datasources
  • Programmatic access to the RadComboBox object model which allows to dynamic creation of comboboxes, populate items, set properties.
  • Customizable appearance through built-in or user-defined skins.

Items

Each item has a Text and a Value property. The value of the Text property is displayed in the RadComboBox control, while the Value property is used to store any additional data about the item, such as data passed to the postback event associated with the item.

You can find information on the server API of RadComboBox at .

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("ComboBox", typeof(RadComboBox))]
[EmbeddedSkin("ComboBox", "Default", typeof(RadComboBox))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadComboBox))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredScript(typeof(OData))]
[RequiredScript(typeof(DropDown))]
[RequiredScript(typeof(jQueryPlugins))]
[ClientScriptResource("Telerik.Web.UI.RadComboBox", "Telerik.Web.UI.ComboBox.RadComboBoxScripts.js")]
[RequiredScript(typeof(TouchScrollExtender))]
[RequiredScript(typeof(MaterialRipple))]
[ValidationProperty("Text")]
[ControlValueProperty("SelectedValue")]
[TelerikToolboxCategory("Data Editing")]
[ToolboxBitmap(typeof(RadComboBox), "Toolbox.Icons.ComboBox.png")]
public class RadComboBox : ControlItemContainer, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, INamingContainer, IXmlSerializable, IControlItemContainer, IPostBackEventHandler, ICallbackEventHandler, IEditableTextControl, ITextControl, IFlatBoundContainer

Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlControlItemContainerRadComboBox...

Implements: IAttributeAccessorICallbackEventHandlerIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlItemContainerIControlResolverIDataBindingsAccessorIDisposableIEditableTextControlIExpressionsAccessorIFeatureGroupIFlatBoundContainerINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlITextControlIUrlResolutionServiceIXmlSerializable...

Inherited Members ControlItemContainer.PrepareForDataBinding()ControlItemContainer.GetXml()ControlItemContainer.LoadXml(string)ControlItemContainer.CreateItem(ClientStateLogEntry)ControlItemContainer.FindChild<TControlItem>(Predicate<TControlItem>)ControlItemContainer.GetAllChildren<TControlItem>()ControlItemContainer.FindChildByValue<TControlItem>(string)ControlItemContainer.FindChildByValue<TControlItem>(string, bool)ControlItemContainer.FindChildByText<TControlItem>(string)ControlItemContainer.FindChildByText<TControlItem>(string, bool)ControlItemContainer.FindChildByAttribute<TControlItem>(string, string)ControlItemContainer.InitializeItem(ControlItem)ControlItemContainer.ReadXml(XmlReader)ControlItemContainer.GetItemTypeFromXmlTagName(string)ControlItemContainer.ReadXmlForChildren(XmlReader)ControlItemContainer.WriteXml(XmlWriter)ControlItemContainer.WriteXmlForChildren(XmlWriter)ControlItemContainer.GetXml(XmlSerializer, TextWriter)ControlItemContainer.LoadXml(ControlItemContainer)ControlItemContainer.LoadViewState(object)ControlItemContainer.SaveViewState()ControlItemContainer.TrackViewState()ControlItemContainer.FindItemByHierarchicalIndex(string)ControlItemContainer.GetPostbackEventReference()ControlItemContainer.AppendDataBoundItemsControlItemContainer.DataTextFieldControlItemContainer.DataValueFieldControlItemContainer.DataTextFormatStringControlItemContainer.ValidationGroupControlItemContainer.PostBackUrlControlItemContainer.CausesValidationControlItemContainer.KeyboardNavigationSettingsControlItemContainer.TemplateControlItemContainer.ChildrenControlItemContainer.TagKeyDataBoundControl.OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)DataBoundControl.GetData()DataBoundControl.GetDataSource()DataBoundControl.MarkAsDataBound()DataBoundControl.OnDataPropertyChanged()DataBoundControl.OnDataSourceViewChanged(object, EventArgs)DataBoundControl.OnPagePreLoad(object, EventArgs)DataBoundControl.ValidateDataSource(object)DataBoundControl.DataMemberDataBoundControl.IsUsingModelBindersDataBoundControl.ItemTypeDataBoundControl.SelectMethodDataBoundControl.DataSourceIDDataBoundControl.DataSourceObjectDataBoundControl.CreatingModelDataSourceDataBoundControl.CallingDataMethodsBaseDataBoundControl.ConfirmInitState()BaseDataBoundControl.EnsureDataBound()BaseDataBoundControl.OnDataBound(EventArgs)BaseDataBoundControl.DataSourceBaseDataBoundControl.InitializedBaseDataBoundControl.IsBoundUsingDataSourceIDBaseDataBoundControl.IsDataBindingAutomaticBaseDataBoundControl.SupportsDisabledAttributeBaseDataBoundControl.RequiresDataBindingBaseDataBoundControl.DataBoundWebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SkinIDWebControl.TabIndexWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.MapPathSecure(string)Control.OpenFile(string)Control.BuildProfileTree(string, bool)Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.HasChildViewStateControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadComboBox()

Properties

Determines whether the noscript tag containing select element to be rendered.

C#
[Bindable(true)]
public bool AccessibilityMode { get; set; }

Determines whether custom text can be entered into the input field of RadComboBox.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("allowCustomText")]
public bool AllowCustomText { get; set; }

Gets the object that controls the Wai-Aria settings applied on the control's element.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public WaiAriaSettings AriaSettings { get; }

Gets or sets a list of separators: autocomplete logic is reset afer a separator is entered and users can autocomplete multiple items.

C#
[ClientControlProperty]
[ClientPropertyName("autoCompleteSeparator")]
[Bindable(false)]
public string AutoCompleteSeparator { get; set; }

You can use several separators at once.

Example:
cs-api-definition
RadComboBox1.AutoCompleteSeparator = ";,";

Gets or sets a value indicating whether a postback to the server automatically occurs when the user changes the RadComboBox selection.

C#
[Bindable(false)]
public bool AutoPostBack { get; set; }

Set this property to true if the server needs to capture the selection as soon as it is made. For example, other controls on the Web page can be automatically filled depending on the user's selection from a list control.

This property can be used to allow automatic population of other controls on the Web page based on a user's selection from a list.

The value of this property is stored in view state.

The server-side event that is fired is SelectedIndexChanged.

C#
protected HttpBrowserCapabilities Browser { get; }

Determines whether the text can be entered into the input field of RadComboBox during keyboard navigation

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("changeText")]
public bool ChangeTextOnKeyBoardNavigation { get; set; }

Gets or sets a value indicating whether the combobox should display the checkboxes for its items.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_checkBoxes")]
public bool CheckBoxes { get; set; }

Gets the currently checked items in the RadComboBox.

C#
[Browsable(false)]
public virtual IList<RadComboBoxItem> CheckedItems { get; }

Gets or sets a value indicating whether the combobox should display the checked items texts in case they do not fit in the control input.

C#
[ClientControlProperty]
[ClientPropertyName("_checkedItemsTexts")]
public RadComboBoxCheckedItemsTexts CheckedItemsTexts { get; set; }

Gets a list of all client-side changes (adding an item, removing an item, changing an item's property) which have occurred.

C#
[Browsable(false)]
public IList<ClientOperation<RadComboBoxItem>> ClientChanges { get; }
Property Value:

A list of ClientOperation<T> objects which represent all client-side changes the user has performed. By default the ClientChanges property returns empty list. Client-changes are recorded if and only if the client-side methods trackChanges()/commitChanges() have been invoked.

You can use the ClientChanges property to respond to client-side modifications such as

  • adding a new item
  • removing existing item
  • clearing the children of an item or the control itself
  • changing a property of the item

The ClientChanges property is available in the first postback (ajax) request after the client-side modifications have taken place. After this moment the property will return empty list.

Example:
cs-api-definition
foreach (ClientOperation&lt;RadComboBoxItem&gt; operation in RadToolBar1.ClientChanges)
{
RadComboBoxItem item = operation.Item;

switch (operation.Type)
{
case ClientOperationType.Insert:
//An item has been inserted - operation.Item contains the inserted item
break;
case ClientOperationType.Remove:
//An item has been inserted - operation.Item contains the removed item.
//Keep in mind the item has been removed from the combobox.
break;
case ClientOperationType.Update:
UpdateClientOperation&lt;RadComboBoxItem&gt; update = operation as UpdateClientOperation&lt;RadComboBoxItem&gt;
//The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
break;
case ClientOperationType.Clear:
//All children of the combobox have been removed - operation.Item will always be null.
break;
}
}

Gets or sets the template for displaying the items in RadcomboBox.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
public virtual string ClientItemTemplate { get; set; }

Determines whether drop down should be closed on blur

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("closeDropDownOnBlur")]
public bool CloseDropDownOnBlur { get; set; }

Gets the settings for the animation played when an item closes.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public AnimationSettings CollapseAnimation { get; }
Property Value:

An AnimationSettings that represents the collapse animation.

Use the CollapseAnimation property to customize the collapse animation of RadComboBox. You can specify the Type, Duration and the items are collapsed.
To disable collapse animation effects you should set the Type to AnimationType.None. To customize the expand animation you can use the CollapseAnimation property.

Example:
cs-api-definition

Gets or sets a value indicating the timeout after which a dropdown starts to close.

C#
[ClientControlProperty]
[ClientPropertyName("collapseDelay")]
public int CollapseDelay { get; set; }
Property Value:

An integer specifying the timeout measured in milliseconds. The default value is 0 milliseconds.

Use the CollapseDelay property to delay dropdown closing. To cause immediate item closing set this property to 0 (zero).

To customize the timeout prior to item closing use the ExpandDelay property.

Example:
C#
<p>The following example demonstrates how to specify one second (1000
milliseconds) timeout prior to dropdown closing:</p>
<p>ASPX:</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1" runat="server"
<strong>ClosingDelay="1000"</strong> /&gt;</p>

The client-side id of the inner input element used for intergation with RadLabel

C#
public string ControlId { get; }

Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy.

C#
public override ControlCollection Controls { get; }
Property Value:

The collection of child controls for the specified server control.

Overrides: Control.Controls

The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()

C#
protected override string CssClassFormatString { get; }

Overrides: RadDataBoundControl.CssClassFormatString

Example:
C#
protected override string CssClassFormatString
{
       get
       {
           return "RadDock RadDock_{0} rdWTitle rdWFooter";
       }
}

Gets or sets the the selected culture. Localization strings will be loaded based on this value.

C#
public CultureInfo Culture { get; set; }
Property Value:

The culture.

Gets or sets which datasource field will represent the "Checked" state of an item checkbox.

C#
[Bindable(true)]
public string DataCheckedField { get; set; }

DefaultItem

RadComboBoxDefaultItem

Gets or set the default item in the RadComboBox.

C#
[Browsable(false)]
public virtual RadComboBoxDefaultItem DefaultItem { get; set; }

Gets or sets whether to enable/disable the RadComboBox drop down auto width.

C#
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("_dropDownAutoWidth")]
public RadComboBoxDropDownAutoWidth DropDownAutoWidth { get; set; }

Gets or sets an additional Cascading Style Sheet (CSS) class applied to the Drop Down.

C#
[ClientPersistedProperty]
public virtual string DropDownCssClass { get; set; }

By default the visual appearance of the Drop Down is defined in the skin CSS file. You can use the DropDownCssClass property to specify a CSS class to be applied in addition to the default CSS class.

Gets or sets the width of the dropdown in pixels.

C#
[Bindable(true)]
public Unit DropDownWidth { get; set; }

Gets or sets the empty message.

C#
[Themeable(true)]
[ClientControlProperty]
public virtual string EmptyMessage { get; set; }
Property Value:

The empty message.

When set to true enables support for WAI-ARIA.

C#
[ClientControlProperty]
[ClientPropertyName("enableAriaSupport")]
public bool EnableAriaSupport { get; set; }

Gets or sets a value indicating whether the combobox should handle the items request automatically on the server.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_lodIsAutomatic")]
public bool EnableAutomaticLoadOnDemand { get; set; }

Gets or sets a value indicating whether the combobox should display the checkboxes for its items.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_enableCheckAllItemsCheckBox")]
public bool EnableCheckAllItemsCheckBox { get; set; }

Gets or sets a value indicating whether any databinding expressions specified in the ItemTemplate should be evaluated for unbound items (items added inline or programmatically).

C#
public bool EnableItemBindingExpressions { get; set; }
Property Value:

true if databinding expressions should be evaluated; otherwise false; The default value is false.

Gets or sets a value indicating whether the combobox should cache items loaded on demand or via webservice

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("enableItemCaching")]
public bool EnableItemCaching { get; set; }

Gets or sets a value indicating whether the combobox should issue a callback to the server whenever end-users change the text of the combo (keypress, paste, etc).

C#
[Bindable(false)]
public bool EnableLoadOnDemand { get; set; }

In Load On Demand mode, the combobox starts a callback after a specified amount of time (see ItemRequestTimeout) and calls the server-side ItemsRequested event. Depending on the value of the event arguments, you can add new items to the combobox object and the items will be propagated to the browser after the request.

Gets or sets a value indicating whether the Overlay element is rendered when supported. True by default.

C#
[ClientControlProperty]
[ClientPropertyName("_enableOverlay")]
public bool EnableOverlay { get; set; }
Property Value:

The enable overlay.

Determines whether the Screen Boundaries Detection is enabled or not.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_enableScreenBoundaryDetection")]
public bool EnableScreenBoundaryDetection { get; set; }

Gets or sets a value indicating whether the text of combobox should be selected

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("enableTextSelection")]
public bool EnableTextSelection { get; set; }

Gets or sets a value indicating whether the combobox should load items on demand (via callback) during scrolling-down the drop-down area.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_virtualScroll")]
public bool EnableVirtualScrolling { get; set; }

Determines the custom error message to be shown after the Load On Demand Callback error appears.

C#
[Bindable(false)]
public string ErrorMessage { get; set; }

Gets the settings for the animation played when the dropdown opens.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public AnimationSettings ExpandAnimation { get; }
Property Value:

An AnimationSettings that represents the expand animation.

Use the ExpandAnimation property to customize the expand animation of RadComboBox. You can specify the Type, Duration and the To disable expand animation effects you should set the Type to AnimationType.None.
To customize the collapse animation you can use the CollapseAnimation property.

Example:
cs-api-definition
void Page_Load(object sender, EventArgs e)
{
RadComboBox1.ExpandAnimation.Type = AnimationType.Linear;
RadComboBox1.ExpandAnimation.Duration = 300;
}

Gets or sets a value indicating the timeout after which a dropdown starts to open.

C#
[ClientControlProperty]
[ClientPropertyName("expandDelay")]
public int ExpandDelay { get; set; }
Property Value:

An integer specifying the timeout measured in milliseconds. The default value is 0 milliseconds.

Use the ExpandDelay property to delay dropdown opening.

To customize the timeout prior to item closing use the CollapseDelay property.

Example:
C#
<p>The following example demonstrates how to specify a half second (500
milliseconds) timeout prior to dropdown opening:</p>
<p>ASPX:</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1" runat="server"
<strong>ExpandDelay="500"</strong> /&gt;</p>

Gets or sets a value indicating the opening direction of RadComboBox dropdown. If this property is not set - by default dropdown opens downwards.

C#
[ClientControlProperty]
[ClientPropertyName("expandDirection")]
public virtual RadComboBoxExpandDirection ExpandDirection { get; set; }

Gets or sets a value indicating whether the combobox should automatically autocomplete and highlight the currently typed text to the all items text match.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("filter")]
public RadComboBoxFilter Filter { get; set; }

Get a footer of RadcomboBox.

C#
[Browsable(false)]
public WebControl Footer { get; }

Gets or sets the template for displaying footer in RadcomboBox.

C#
[TemplateContainer(typeof(RadComboBoxItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public virtual ITemplate FooterTemplate { get; set; }

Get a header of RadcomboBox.

C#
[Browsable(false)]
public WebControl Header { get; }

Gets or sets the template for displaying header in RadcomboBox.

C#
[TemplateContainer(typeof(RadComboBoxItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public virtual ITemplate HeaderTemplate { get; set; }

Gets or sets a value indicating whether items defined in the ItemTemplate template should be automatically highlighted on mouse hover or keyboard navigation.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("highlightTemplatedItems")]
public bool HighlightTemplatedItems { get; set; }

Gets or sets an additional Cascading Style Sheet (CSS) class applied to the Input.

C#
public virtual string InputCssClass { get; set; }

By default the visual appearance of the Input is defined in the skin CSS file. You can use the InputCssClass property to specify a CSS class to be applied in addition to the default CSS class.

Gets or sets a value that indicates whether the combobox autocompletion logic is case-sensitive or not.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("isCaseSensitive")]
public bool IsCaseSensitive { get; set; }

Gets a value indicating whether the current instance of the combobox has child items.

C#
[Browsable(false)]
[Bindable(false)]
public bool IsEmpty { get; }
Example:
cs-api-definition
If RadComboBox1.IsEmpty
'
'
'
End If

Specifies the timeout after each keypress before RadComboBox fires an AJAX callback to the ItemsRequested server-side event.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("itemRequestTimeout")]
public int ItemRequestTimeout { get; set; }

In miliseconds. ItemRequestTimeout = 500 is equal to half a second delay.

Gets a RadComboBoxItemCollection object that contains the items of the current RadComboBox control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadComboBoxItemCollection Items { get; }
Property Value:

A RadComboBoxItemCollection that contains the items of the current RadComboBox control. By default the collection is empty (RadComboBox has no children).

Use the Items property to access the child items of RadComboBox You can add, remove or modify items from the Items collection.

Example:
cs-api-definition
RadComboBox1.Items[0].Text = "Example";
RadComboBox1.Items[0].Value = "1";

Gets or sets the number of Items the RadComboBox will load per Item request.

C#
public int ItemsPerRequest { get; set; }

Set this property to -1 to load all Items when EnableAutomaticLoadOnDemand is set to true and disable Virtual Scrolling/Show More Results. The default is -1.

Gets or sets the template for displaying the items in RadcomboBox.

C#
[TemplateContainer(typeof(RadComboBoxItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public virtual ITemplate ItemTemplate { get; set; }
Property Value:

A ITemplate implemented object that contains the template for displaying combo items. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.

The ItemTemplate property sets a template that will be used for all combo items.

Example:
C#
<p>The following example demonstrates how to use the
<strong>ItemTemplate</strong> property to add a CheckBox for each item.</p>
<p>ASPX:</p>
<p>&lt;telerik:RadComboBox runat="server" ID="RadComboBox1"&gt;</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
    <p>&lt;ItemTemplate&gt;</p>
    <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
        <p>&lt;asp:CheckBox runat="server"
        ID="CheckBox"&gt;&lt;/asp:CheckBox&gt;<br />
        &lt;asp:Label runat="server" ID="Label1"</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
            <p>Text='&lt;%# DataBinder.Eval(Container, "Text") %&gt;'</p>
            <p>&gt;&lt;/asp:Label&gt;</p>
        </blockquote>
    </blockquote>
    <p>&lt;/ItemTemplate&gt;</p>
    <p>&lt;Items&gt;</p>
    <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
        <p>&lt;telerik:RadComboBoxItem Text="News" /&gt;</p>
        <p>&lt;telerik:RadComboBoxItem Text="Sports" /&gt;</p>
        <p>&lt;telerik:RadComboBoxItem Text="Games" /&gt;</p>
    </blockquote>
    <p>&lt;/Items&gt;</p>
</blockquote>
<p>&lt;/telerik:RadComboBox&gt;</p>

Gets or sets the label of the control.

C#
public virtual string Label { get; set; }
Property Value:

The label of the control.

Gets or sets the css class of the label.

C#
public virtual string LabelCssClass { get; set; }
Property Value:

The label CSS class.

The value of the message that is shown in RadComboBox while AJAX callback call is in effect.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("loadingMessage")]
public string LoadingMessage { get; set; }

This property can be used for customizing and localizing the text of the loading message.

Gets the localization.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public ComboBoxStrings Localization { get; }
Property Value:

The localization.

Gets or sets a value indicating where RadComboBox will look for its .resx localization files.

C#
public string LocalizationPath { get; set; }
Property Value:

The localization path.

Gets or sets a value indicating whether the combobox should automatically autocomplete and highlight the currently typed text to the closest item text match.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("markFirstMatch")]
public bool MarkFirstMatch { get; set; }

Gets or sets the max height of the dropdown in pixels.

C#
[Bindable(true)]
public Unit MaxHeight { get; set; }

Gets or sets the maximum number of characters allowed in the combobox.

C#
public virtual int MaxLength { get; set; }

Gets or sets the minimum length of the typed text before the control initiates a request for new Items when EnableLoadOnDemand is True.

C#
[ClientControlProperty]
[ClientPropertyName("_minFilterLength")]
public int MinFilterLength { get; set; }
Property Value:

The length of the min filter.

Gets or sets a value indicating whether the text in a combobox item automatically continues on the next line when it reaches the end of the dropdown.

C#
[Bindable(false)]
public bool NoWrap { get; set; }

Gets or sets a value indicating the horizontal offset of the combobox dropdown

C#
[ClientControlProperty]
[ClientPropertyName("offsetX")]
public int OffsetX { get; set; }
Property Value:

An integer specifying the horizontal offset of the combobox dropdown (measured in pixels). The default value is 0 (no offset).

Use the OffsetX property to change the position of the combobox dropdown

To customize the vertical offset use the OffsetY property.

Gets or sets a value indicating the vertical offset of the combobox dropdown.

C#
[ClientControlProperty]
[ClientPropertyName("offsetY")]
public int OffsetY { get; set; }
Property Value:

An integer specifying the vertical offset of the combobox dropdown(measured in pixels). The default value is 0 (no offset).

Use the OffsetY property to change the position where the combobox dropdown will appear.

To customize the horizontal offset use the OffsetX property.

The client-side event that is fired when when the combo loses focus

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("onClientBlur")]
public string OnClientBlur { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args.

Example:
C#
&lt;script type="text/avascript"&gt;

function OnClientBlur(sender,args)
{
alert("blur");
}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientBlur="OnClientBlur"&gt;
&lt;/telerik:radcombobox&gt;

Gets or sets the name of the JavaScript function which handles the checkAllItemChecked client-side event.

C#
[ClientControlEvent]
[ClientPropertyName("checkAllChecked")]
public string OnClientCheckAllChecked { get; set; }

The JavaScript function executed when CheckAll checkbox is checked.

Gets or sets the name of the JavaScript function which handles the checkAllItemChecked client-side event.

C#
[ClientControlEvent]
[ClientPropertyName("checkAllChecking")]
public string OnClientCheckAllChecking { get; set; }

The JavaScript function executed before CheckAll checkbox is checked.

The client-side event that is fired after the dropdown of the combobox is closed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("dropDownClosed")]
public string OnClientDropDownClosed { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args. The event can not be cancelled

Example:
C#
&lt;script language="javascript"&gt;

function HandleClose(sender, args)
{
alert("Closed combobox with " + sender.get_items().get_count() + " items");

}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientDropDownClosed="HandleClose"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired before the dropdown of the combobox is closed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("dropDownClosing")]
public string OnClientDropDownClosing { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args. The event can be cancelled - simply set args.set_cancel to true args.set_cancel(true); from the event handler and the combobox dropdown will not be closed.

Example:
C#
&lt;script language="javascript"&gt;

function HandleClose(sender, args)
{
if (someCondition)
{
args.set_cancel(true);
}
else
{
alert("Closing combobox with " + sender.get_items().get_count() + " items");
}
}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientDropDownClosing="HandleClose"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired after the dropdown of the combobox is opened.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("dropDownOpened")]
public string OnClientDropDownOpened { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args. The event cannot be cancelled.

Example:
C#
&lt;script language="javascript"&gt;

function HandleOpen(sender,args)
{
alert("Opening combobox with " + comboBox.get_items().get_count() + " items");

}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientDropDownOpened="HandleOpen"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired before the dropdown of the combobox is opened.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("dropDownOpening")]
public string OnClientDropDownOpening { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args. The event can be cancelled - simply set args.set_cancel to true args.set_cancel(true); from the event handler and the combobox dropdown will not be opened.

Example:
C#
&lt;script language="javascript"&gt;

function HandleOpen(sender,args)
{
if (someCondition)
{
args.set_cancel(true);
}
else
{
alert("Opening combobox with " + comboBox.get_items().get_count() + " items");
}
}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientDropDownOpening="HandleOpen"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired when when the combo gains focus

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("onClientFocus")]
public string OnClientFocus { get; set; }

The event handler receives two parameter: the instance of the combobox client-side object and event args.

Example:
C#
&lt;script type="text/avascript"&gt;

function OnClientFocus(sender,args)
{
alert("focus");
}

&lt;/script&gt;


&lt;telerik:radcombobox
id="RadComboBox1"
Runat="server"
OnClientFocus="OnClientFocus"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired after a RadComboBox item has been checked.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemChecked")]
public string OnClientItemChecked { get; set; }

The event handler receives two parameters: the instance of of the combobox client-side object and event argument with the newly checked item.

Example:
C#
&lt;script language="javascript"&gt;
function onClientItemChecked(sender,eventArgs)
{
var item = eventArgs.get_item();
// alert the new item text and value.
alert(item.get_text() + ":" + item.get_value());
}
&lt;/script&gt;

&lt;telerik:radcombobox ID="RadComboBox1" runat="server"
OnClientItemChecked="onClientItemChecked"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired when a RadComboBox item is about to be checked.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemChecking")]
public string OnClientItemChecking { get; set; }

The event handler receives two parameters: the instance of of the RadComboBox client-side object and event argument of the newly checked item.

The event can be cancelled - simply call args.set_cancel(true); from the event handler and the item will not be changed.

Example:
C#
&lt;script type="text/javascript"&gt;
function onClientIndexChecking(sender, eventArgs)
{
var item = eventArgs.get_item();
if (item.get_text() == "LA")
{
// do not allow checking an item with text "LA"
return false;
}
else
{
// alert the new item text and value.
alert(item.get_text() + ":" + item.get_value());
}
}
&lt;/script&gt;

&lt;telerik:radcombobox ID="RadComboBox1" runat="server"
OnClientIndexChecking="onClientIndexChecking"&gt;
&lt;/telerik:radcombobox&gt;

Gets or sets the name of the JavaScript function called when an Item is created during Web Service Load on Demand.

C#
[ClientControlEvent]
[ClientPropertyName("itemDataBound")]
public string OnClientItemDataBound { get; set; }

Gets or sets a value indicating the client-side event handler that is called when the RadComboBox items were just populated (for example from web service).

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequested")]
public string OnClientItemsRequested { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClientItemsRequested client-side event handler is called when the RadComboBox items were just populated. Two parameters are passed to the handler:

  • sender, the menu client object;
  • eventArgs, null for this event.

This event cannot be cancelled.

Example:
C#
<p>&lt;script type="text/javascript"&gt;<br />
function onItemsRequested(sender, eventArgs)<br />
{<br />
       alert("Loading finished");<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1"<br />
runat="server"<br />
    <strong>OnClientItemsRequested="onItemsRequested"</strong>&gt;<br />
....<br />
&lt;/telerik:RadComboBox&gt;</p>

Gets or sets a value indicating the client-side event handler that is called when the operation for populating the RadComboBox has failed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequestFailed")]
public string OnClientItemsRequestFailed { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClientItemsRequestFailed client-side event handler is called when the operation for populating the RadComboBox has failed. Two parameters are passed to the handler:

  • sender, the menu client object;
  • eventArgs with one property:
    • set_cancel(), set to true to suppress the default action (alert message).

This event can be cancelled.

Example:
C#
<p>&lt;script type="text/javascript"&gt;<br />
function onItemsRequestFailed(sender, eventArgs)<br />
{<br />
       alert("Error: " + errorMessage);<br />
       eventArgs.set_cancel(true);<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1"<br />
runat="server"<br />
    <strong>OnClientItemsRequestFailed="onItemsRequestFailed"</strong>&gt;<br />
....<br />
&lt;/telerik:RadComboBox&gt;</p>

Gets or sets a value indicating the client-side event handler that is called when the RadComboBox is about to be populated (for example from web service).

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequesting")]
public string OnClientItemsRequesting { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClientItemsRequesting client-side event handler is called when the RadComboBox is about to be populated. Two parameters are passed to the handler:

  • sender, the menu client object;
  • eventArgs with three properties:
    • get_context(), an user object that will be passed to the web service.
    • set_cancel(), used to cancel the event.

This event can be cancelled.

Example:
C#
<p>&lt;script type="text/javascript"&gt;<br />
function onItemRequestingHandler(sender, eventArgs)<br />
{<br />
       var context = eventArgs.get_context();<br />
       context["Parameter1"] = "Value";<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1"<br />
runat="server"<br />
    <strong>OnClientItemPopulating="onClientItemPopulatingHandler"</strong>&gt;<br />
....<br />
&lt;/telerik:RadComboBox&gt;</p>

The client-side event that is fired when the user presses a key inside the combobox.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("keyPressing")]
public string OnClientKeyPressing { get; set; }

The event handler receives two parameters:

  • the instance of the combobox client-side object;
  • browser event arguments.

You can use the browser event arguments (and the keyCode property in particular) to detect which key was pressed and to write your own custom logic.

Example:
C#
&lt;telerik:radcombobox
Runat="server"
ID="RadComboBox3"
OnClientKeyPressing="HandleKeyPress"
...
/&gt;

&lt;script type="text/javascript"&gt;

function HandleKeyPress(sender, e)
{
if (e.keyCode == 13)
{
document.forms[0].submit();
}
}

&lt;/script&gt;

Gets or sets a value indicating the client-side event handler that is called after the RadComboBox client-side object is initialized.

C#
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClienLoad client-side event handler is called after the combobox is fully initialized on the client.

A single parameter - the combobox client object - is passed to the handler.

This event cannot be cancelled.

Example:
C#
<p>&lt;script type="text/javascript"&gt;<br />
function onClientLoadHandler(sender)<br />
{<br />
       alert(sender.get_id());<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;telerik:RadComboBox ID="RadComboBox1"<br />
runat= "server"<br />
    <strong>OnClientLoad="onClientLoadHandler"</strong>&gt;<br />
....<br />
&lt;/telerik:RadComboBox&gt;</p>

The client-side event that is fired after the selected index of the RadComboBox has been changed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("selectedIndexChanged")]
public string OnClientSelectedIndexChanged { get; set; }

The event handler receives two parameters: the instance of of the combobox client-side object and event argument with the newly selected item.

Example:
C#
&lt;script language="javascript"&gt;
function onSelectedIndexChanged(sender,eventArgs)
{
var item = eventArgs.get_item();
// alert the new item text and value.
alert(item.get_text() + ":" + item.get_value());
}
&lt;/script&gt;

&lt;telerik:radcombobox ID="RadComboBox1" runat="server"
OnClientSelectedIndexChanged="onSelectedIndexChanged"&gt;
&lt;/telerik:radcombobox&gt;

The client-side event that is fired when the selected index of the RadComboBox is about to be changed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("selectedIndexChanging")]
public string OnClientSelectedIndexChanging { get; set; }

The event handler receives two parameters: the instance of of the RadComboBox client-side object and event argument of the newly selected item.

The event can be cancelled - simply call args.set_cancel(true); from the event handler and the item will not be changed.

Example:
C#
&lt;script type="text/javascript"&gt;
function onSelectedIndexChanging(sender, eventArgs)
{
var item = eventArgs.get_item();
if (item.get_text() == "LA")
{
// do not allow selecting item with text "LA"
return false;
}
else
{
// alert the new item text and value.
alert(item.get_text() + ":" + item.get_value());
}
}
&lt;/script&gt;

&lt;telerik:radcombobox ID="RadComboBox1" runat="server"
OnClientSelectedIndexChanging="onSelectedIndexChanging"&gt;
&lt;/telerik:radcombobox&gt;

Gets or sets the name of the JavaScript function called when the client template for an item is evaluated

C#
[ClientControlEvent]
[ClientPropertyName("templateDataBound")]
public string OnClientTemplateDataBound { get; set; }

The client-side event that is fired when the selected index of RadCombobox has changed.

C#
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("textChange")]
public string OnClientTextChange { get; set; }
Property Value:

The on client text change.

Gets or sets a value that indicates whether the dropdown of the combobox should be opened by default on loadnig the page.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_openDropDownOnLoad")]
public bool OpenDropDownOnLoad { get; set; }

Sets or gets the position (left or right) of the arrow image dropdown.

C#
[Bindable(false)]
public RadComboBoxImagePosition RadComboBoxImagePosition { get; set; }

By default the image is shown on the right. Left can be used in RTL (right-to-left) language scenarios.

Example:
cs-api-definition
RadComboBox1.RadComboBoxImagePosition = RadComboBoxImagePosition.Left;

Gets or sets a value indicating whether the ComboBox should render as a <select> element. When enabled the ComboBox will have its functionality reduced to that of the <select> element.

C#
[Obsolete("This property is obsolete. Use RenderMode.Native instead")]
public RadComboBoxRenderingMode RenderingMode { get; set; }
C#
protected DataSourceSelectArguments SelectArguments { get; }

Gets the index of the currently selected item in the combobox.

C#
[Bindable(true)]
[Browsable(false)]
[ClientControlProperty]
[ClientPropertyName("selectedIndex")]
public virtual int SelectedIndex { get; set; }

Gets the currently selected item in the combobox.

C#
[Bindable(false)]
[Browsable(false)]
public virtual RadComboBoxItem SelectedItem { get; }

SelectedItem can be null in load-on-demand or AllowCustomText modes. End-users can type any text.

Example:
cs-api-definition
&lt;telerik:radcombobox id="RadComboBox1" Runat="server" &gt;&lt;/telerik:radcombobox&gt;

private void RadComboBox1_SelectedIndexChanged(object o, Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs e)
{
Label1.Text = RadComboBox1.SelectedItem.Text;
}

Gets the value of the currently selected item in the combobox.

C#
[Browsable(false)]
[Bindable(true, BindingDirection.TwoWay)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("_value")]
public virtual string SelectedValue { get; set; }

Determines whether the dropdown shows when the user clicks in the input field.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_showDropDownOnTextboxClick")]
public bool ShowDropDownOnTextboxClick { get; set; }

Gets or sets a value indicating whether the combobox should display the box for requesting additional items

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_showMoreResultsBox")]
public bool ShowMoreResultsBox { get; set; }

Gets or sets a value indicating whether the dropdown image next to the combobox text area should be displayed.

C#
[Bindable(false)]
public bool ShowToggleImage { get; set; }

The dropdown image is located in the Skins folder of the combo - by default ~/RadControls/ComboBox/Skins/{SkinName}/DropArrow.gif. You can custmoize or modify the image and place it in the respective folder of the skin you are using.

Indicates whether the combobox will be visible while loading.

C#
[Bindable(false)]
public bool ShowWhileLoading { get; set; }
C#
public virtual string SmartPasteDescription { get; set; }

Automatically sorts items alphabetically (based on the Text property) in ascending or descending order.

C#
[Bindable(false)]
public RadComboBoxSort Sort { get; set; }
Example:
cs-api-definition
RadComboBox1.Sort = RadComboBoxSort.Ascending;
RadComboBox1.Sort = RadComboBoxSort.Descending;
RadComboBox1.Sort = RadComboBoxSort.None;

Gets/sets whether the sorting will be case-sensitive or not. By default is set to true.

C#
[Bindable(false)]
public bool SortCaseSensitive { get; set; }
Example:
cs-api-definition
RadComboBox1.SortCaseSensitive = false;
C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadDataBoundControl.SupportsRenderingMode

Gets or sets the text content of the RadComboBox control.

C#
[Bindable(false)]
[ClientControlProperty]
[ClientPropertyName("_text")]
public string Text { get; set; }

In standard mode, the currently selected text can be accessed using both the Text property or RadCombobox.SelectedItem.Text. In AJAX callback modes, only the Text property can be used because end-users can type or paste text that does not match the text of any item and SelectedItem can be null.

Example:
cs-api-definition
string comboText = RadComboBox1.Text

Gets the unique, hierarchically qualified identifier for the server control.

C#
[ClientControlProperty]
[ClientPropertyName("_uniqueId")]
public override string UniqueID { get; }
Property Value:

The fully qualified identifier for the server control.

Overrides: Control.UniqueID

Gets the settings for the web service used to populate items.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public NavigationControlWebServiceSettings WebServiceSettings { get; }
Property Value:

An WebServiceSettings that represents the web service used for populating items.

Use the WebServiceSettings property to configure the web service used to populate items on demand. You must specify both Path and Method to fully describe the service.

In order to use the integrated support, the web service should have the following signature:

   <pre><code class="lang-csharp">[ScriptService]

public class WebServiceName : WebService { [WebMethod] public RadComboBoxItemData[] WebServiceMethodName(object context) { // We cannot use a dictionary as a parameter, because it is only supported by script services. // The context object should be cast to a dictionary at runtime. IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;

    //...
}

}

The HTML Z-index of the items dropdown of RadComboBox.Its default value is 6000.

C#
[Bindable(false)]
public int ZIndex { get; set; }

Can be used when the dropdown is to be shown over content with a specified Z-index. If the combobox items dropdown is displayed below the content, set the ZIndex property to a value higher than the value of the HTML content below.

Methods

C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadDataBoundControl.AddAttributesToRender(HtmlTextWriter)

C#
protected bool CheckIfAllItemsAreChecked(string oldText)
Parameters:oldTextstringReturns:

bool

Clears the checked items. The Checked property of all items is set to false.

C#
public virtual void ClearCheckedItems()

Clears out the list selection and sets the Selected property of all items to false.

C#
public virtual void ClearSelection()

Use this method to reset the control so that no items are selected.

Example:
cs-api-definition
RadComboBox1.ClearSelection()
C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

C#
protected override ControlItemCollection CreateChildItemCollection()
Returns:

ControlItemCollection

Overrides: ControlItemContainer.CreateChildItemCollection()

C#
protected override IRenderer CreateControlRenderer()
Returns:

IRenderer

Overrides: RadDataBoundControl.CreateControlRenderer()

Creates a DataSourceSelectArguments object that is configured for paging if the underlying data source supports it.

C#
protected override DataSourceSelectArguments CreateDataSourceSelectArguments()
Returns:

DataSourceSelectArguments

A DataSourceSelectArguments initialized for paging if the underlying data source supports it.

Overrides: DataBoundControl.CreateDataSourceSelectArguments()

C#
protected override ControlItem CreateItem()
Returns:

ControlItem

Overrides: ControlItemContainer.CreateItem()

Binds a data source to the invoked RadComboBox and all its child controls. Does not bind the control if EnableAutomaticLoadOnDemand is true and the page request is not a callback.

C#
public override void DataBind()

Overrides: BaseDataBoundControl.DataBind()

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: ControlItemContainer.DescribeComponent(IScriptDescriptor)

Returns the first RadComboBoxItem that matches the conditions defined by the specified predicate. The predicate should returns a boolean value.

C#
public RadComboBoxItem FindItem(Predicate<RadComboBoxItem> match)
Parameters:matchPredicate<RadComboBoxItem>

The Predicate <> that defines the conditions of the element to search for.

Returns:

RadComboBoxItem

Example:
cs-api-definition
void Page_Load(object sender, EventArgs e)
{
RadComboBox1.FindItem(ItemWithEqualsTextAndValue);
}
private static bool ItemWithEqualsTextAndValue(RadComboBoxItem item)
{
if (item.Text == item.Value)
{
return true;
}
else
{
return false;
}
}

Finds the first RadComboBoxItem with Text that matches the given text value.

C#
public RadComboBoxItem FindItemByText(string text, bool ignoreCase)
Parameters:textstring

The string to search for.

ignoreCasebool

A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).

Returns:

RadComboBoxItem

The first RadComboBoxItem that matches the specified text value.

Example:
cs-api-definition
Dim item As RadComboBoxItem = RadComboBox1.FindItemByText("New York",true)

Finds the first RadComboBoxItem with Text that matches the given text value.

C#
public RadComboBoxItem FindItemByText(string text)
Parameters:textstring

The string to search for.

Returns:

RadComboBoxItem

The first RadComboBoxItem that matches the specified text value.

Example:
cs-api-definition
Dim item As RadComboBoxItem = RadComboBox1.FindItemByText("New York")

Finds the first RadComboBoxItem with Value that matches the given value.

C#
public RadComboBoxItem FindItemByValue(string value, bool ignoreCase)
Parameters:valuestring

The value to search for.

ignoreCasebool

A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).

Returns:

RadComboBoxItem

The first RadComboBoxItem that matches the specified value.

Example:
cs-api-definition
Dim item As RadComboBoxItem = RadComboBox1.FindItemByValue("1", true)

Finds the first RadComboBoxItem with Value that matches the given value.

C#
public RadComboBoxItem FindItemByValue(string value)
Parameters:valuestring

The value to search for.

Returns:

RadComboBoxItem

The first RadComboBoxItem that matches the specified value.

Example:
cs-api-definition
Dim item As RadComboBoxItem = RadComboBox1.FindItemByValue("1")

Returns the index of the first RadComboBoxItem with Text that matches the given text value.

C#
public int FindItemIndexByText(string text, bool ignoreCase)
Parameters:textstring

The string to search for.

ignoreCasebool

A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).

Returns:

int

Returns the index of the first RadComboBoxItem with Text that matches the given text value.

C#
public int FindItemIndexByText(string text)
Parameters:textstring

The string to search for.

Returns:

int

Returns the index of the first RadComboBoxItem with Value that matches the given value.

C#
public int FindItemIndexByValue(string value, bool ignoreCase)
Parameters:valuestring

The value to search for.

ignoreCasebool

A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).

Returns:

int

Returns the index of the first RadComboBoxItem with Value that matches the given value.

C#
public int FindItemIndexByValue(string value)
Parameters:valuestring

The value to search for.

Returns:

int

C#
public override void Focus()

Overrides: Control.Focus()

Gets an array containing the indices of the currently checked items in the RadComboBox control.

C#
public virtual int[] GetCheckedIndices()
Returns:

int[]

C#
protected string GetCheckedItemsTexts()
Returns:

string

Loads combobox items from an XML content file.

C#
public void LoadContentFile(string fileName)
Parameters:fileNamestring

The name of the XML file.

Example:
cs-api-definition
RadComboBox1.LoadContentFile("~/myfile.xml")
C#
protected override void LoadControlState(object savedState)
Parameters:savedStateobject

Overrides: Control.LoadControlState(object)

Executed when post data is loaded from the request

C#
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Parameters:postDataKeystringpostCollectionNameValueCollectionReturns:

bool

Overrides: RadDataBoundControl.LoadPostData(string, NameValueCollection)

Raises the CheckAllCheck event.

C#
protected virtual void OnCheckAllCheck(RadComboBoxCheckAllCheckEventArgs e)
Parameters:eRadComboBoxCheckAllCheckEventArgs

The RadComboBoxCheckAllCheckEventArgs instance containing the event data.

C#
protected override void OnDataBinding(EventArgs e)
Parameters:eEventArgs

Overrides: Control.OnDataBinding(EventArgs)

C#
protected void OnDataSourceViewSelectCallback(IEnumerable data)
Parameters:dataIEnumerable
C#
protected override void OnInit(EventArgs e)
Parameters:eEventArgs

Overrides: RadDataBoundControl.OnInit(EventArgs)

Raises the ItemChecked event.

C#
protected virtual void OnItemChecked(RadComboBoxItemEventArgs e)
Parameters:eRadComboBoxItemEventArgs

The RadComboBoxItemEventArgs instance containing the event data.

Raises the ItematCreated event.

C#
protected virtual void OnItemCreated(RadComboBoxItemEventArgs e)
Parameters:eRadComboBoxItemEventArgs

Raises the ItemDataBound event.

C#
protected virtual void OnItemDataBound(RadComboBoxItemEventArgs e)
Parameters:eRadComboBoxItemEventArgs

Raises the ItemRequestEvent event. This allows you to handle the event directly.

C#
protected virtual void OnItemsRequested(RadComboBoxItemsRequestedEventArgs args)
Parameters:argsRadComboBoxItemsRequestedEventArgs
C#
protected override void OnLoad(EventArgs e)
Parameters:eEventArgs

Overrides: DataBoundControl.OnLoad(EventArgs)

C#
protected override void OnPreRender(EventArgs e)
Parameters:eEventArgs

Overrides: RadDataBoundControl.OnPreRender(EventArgs)

Raises the SelectedIndexChanged event. This allows you to handle the event directly.

C#
protected virtual void OnSelectedIndexChanged()
C#
protected virtual void OnTemplateNeeded(RadComboBoxItemEventArgs e)
Parameters:eRadComboBoxItemEventArgs

Raises the TextChanged event. This allows you to handle the event directly.

C#
protected virtual void OnTextChanged(EventArgs e)
Parameters:eEventArgs
C#
protected override void PerformDataBinding(IEnumerable dataSource)
Parameters:dataSourceIEnumerable

Overrides: ControlItemContainer.PerformDataBinding(IEnumerable)

C#
protected override void PerformSelect()

Overrides: DataBoundControl.PerformSelect()

C#
protected virtual void RaiseCallbackEvent(string eventArgument)
Parameters:eventArgumentstring
C#
protected override void RaiseItemCreated(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseItemCreated(ControlItem)

C#
protected override void RaiseItemDataBound(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseItemDataBound(ControlItem)

Signals the RadComboBox control to notify the ASP.NET application that the state of the control has changed.

C#
protected override void RaisePostDataChangedEvent()

Overrides: RadDataBoundControl.RaisePostDataChangedEvent()

C#
protected bool RaisePostDataEventsIfTextIsChanged(string oldText)
Parameters:oldTextstringReturns:

bool

C#
protected virtual void RaiseSelectedIndexChandedEvent()
C#
protected override void RaiseTemplateNeeded(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemContainer.RaiseTemplateNeeded(ControlItem)

Raises the TextChange event. This allows you to handle the event directly.

C#
protected virtual void RaiseTextChandedEvent()

Renders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers.

C#
public override void RenderBeginTag(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

A HtmlTextWriter that represents the output stream to render HTML content on the client.

Overrides: RadDataBoundControl.RenderBeginTag(HtmlTextWriter)

C#
protected virtual void RenderBrowserSpecificStyles(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadDataBoundControl.RenderContents(HtmlTextWriter)

Override in an inheritor and return false in order to skip Loading/Saving ControlState.

C#
protected virtual bool RequiresControlState()
Returns:

bool

True

C#
protected override object SaveControlState()
Returns:

object

Overrides: Control.SaveControlState()

C#
protected void SetPostDataSelection(int selectedIndex)
Parameters:selectedIndexint

Sorts the items in the RadComboBox.

C#
public void SortItems()
Example:
cs-api-definition
RadComboBox1.Sort=RadComboBoxSort.Ascending
RadComboBox1.SortItems()

Sorts the items in the RadComboBox.

C#
public void SortItems(IComparer comparer)
Parameters:comparerIComparer

An object from IComparer interface.

Example:
cs-api-definition
RadComboBox1.Sort=RadComboBoxSort.Ascending
Dim comparer As MyComparer = New MyComparer()
RadComboBox1.SortItems(comparer)
Public Class MyComparer
Implements IComparer

Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer
Dim p1 As New RadComboBoxItem()
Dim p2 As New RadComboBoxItem()

If TypeOf x Is RadComboBoxItem Then
p1 = TryCast(x, RadComboBoxItem)
Else
Throw New ArgumentException("Object is not of type RadComboBoxItem.")
End If

If TypeOf y Is RadComboBoxItem Then
p2 = TryCast(y, RadComboBoxItem)
Else
Throw New ArgumentException("Object is not of type RadComboBoxItem.")
End If

Dim cmp As Integer = 0
If p1.ComboBoxParent.Sort = RadComboBoxSort.Ascending Then
cmp = [String].Compare(p1.Value, p2.Value, Not p1.ComboBoxParent.SortCaseSensitive)
End If
If p1.ComboBoxParent.Sort = RadComboBoxSort.Descending Then
cmp = [String].Compare(p1.Value, p2.Value, Not p1.ComboBoxParent.SortCaseSensitive) * -1
End If

Return cmp
End Function

End Class

Events

Occurs when the CheckAll checkbox is checked or unchecked.

C#
public event RadComboBoxCheckAllCheckEventHandler CheckAllCheck

Occurs when an item is checked

C#
public event RadComboBoxItemEventHandler ItemChecked

Occurs on the server when an item in the RadComboBox control is created.

C#
public event RadComboBoxItemEventHandler ItemCreated

The ItemCreated event is raised every time a new item is added.

The ItemCreated event is not related to data binding and you cannot retrieve the DataItem of the item in the event handler.

The ItemCreated event is often useful in scenarios where you want to initialize all items - for example setting the ToolTip of each RadComboBoxItem to be equal to the Text property.

Occurs after an item is data bound to the RadComboBox control.

C#
public event RadComboBoxItemEventHandler ItemDataBound

This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is nulled out and no longer available.

Occurs when RadComboBox initiates an AJAX callback to the server.

C#
public event RadComboBoxItemsRequestedEventHandler ItemsRequested

Occurs when the SelectedIndex property has changed.

C#
public event RadComboBoxSelectedIndexChangedEventHandler SelectedIndexChanged

You can create an event handler for this event to determine when the selected index in the RadComboBox has been changed. This can be useful when you need to display information in other controls based on the current selection in the RadComboBox. You can use the event handler to load the information in the other controls.

Occurs before template is being applied to the item.

C#
public event RadComboBoxItemEventHandler TemplateNeeded

The TemplateNeeded event is raised before a template is been applied on the item, both during round-trips (postbacks) and at the time data is bound to the control. The TemplateNeeded event is not raised for items which are defined inline in the page or user control.

The TemplateNeeded event is commonly used for dynamic templating.

Example:
cs-api-definition
protected void RadComboBox1_TemplateNeeded(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
{
string value = e.Item.Value;
if (value != null)
{
// if the value is an even number
if ((Int32.Parse(value) % 2) == 0)
{
var textBoxTemplate = new TextBoxTemplate();
textBoxTemplate.InstantiateIn(e.Item);
}
}
}

Occurs when the text of the RadComboBox changes between postbacks to the server.

C#
public event EventHandler TextChanged

Implements: IEditableTextControl.TextChanged

In this article
DefinitionConstructorsRadComboBox()PropertiesAccessibilityModeAllowCustomTextAriaSettingsAutoCompleteSeparatorAutoPostBackBrowserChangeTextOnKeyBoardNavigationCheckBoxesCheckedItemsCheckedItemsTextsClientChangesClientItemTemplateCloseDropDownOnBlurCollapseAnimationCollapseDelayControlIdControlsCssClassFormatStringCultureDataCheckedFieldDefaultItemDropDownAutoWidthDropDownCssClassDropDownWidthEmptyMessageEnableAriaSupportEnableAutomaticLoadOnDemandEnableCheckAllItemsCheckBoxEnableItemBindingExpressionsEnableItemCachingEnableLoadOnDemandEnableOverlayEnableScreenBoundaryDetectionEnableTextSelectionEnableVirtualScrollingErrorMessageExpandAnimationExpandDelayExpandDirectionFilterFooterFooterTemplateHeaderHeaderTemplateHighlightTemplatedItemsInputCssClassIsCaseSensitiveIsEmptyItemRequestTimeoutItemsItemsPerRequestItemTemplateLabelLabelCssClassLoadingMessageLocalizationLocalizationPathMarkFirstMatchMaxHeightMaxLengthMinFilterLengthNoWrapOffsetXOffsetYOnClientBlurOnClientCheckAllCheckedOnClientCheckAllCheckingOnClientDropDownClosedOnClientDropDownClosingOnClientDropDownOpenedOnClientDropDownOpeningOnClientFocusOnClientItemCheckedOnClientItemCheckingOnClientItemDataBoundOnClientItemsRequestedOnClientItemsRequestFailedOnClientItemsRequestingOnClientKeyPressingOnClientLoadOnClientSelectedIndexChangedOnClientSelectedIndexChangingOnClientTemplateDataBoundOnClientTextChangeOpenDropDownOnLoadRadComboBoxImagePositionRenderingModeSelectArgumentsSelectedIndexSelectedItemSelectedValueShowDropDownOnTextboxClickShowMoreResultsBoxShowToggleImageShowWhileLoadingSmartPasteDescriptionSortSortCaseSensitiveSupportsRenderingModeTextUniqueIDWebServiceSettingsZIndexMethodsAddAttributesToRender(HtmlTextWriter)CheckIfAllItemsAreChecked(string)ClearCheckedItems()ClearSelection()CreateChildControls()CreateChildItemCollection()CreateControlRenderer()CreateDataSourceSelectArguments()CreateItem()DataBind()DescribeComponent(IScriptDescriptor)FindItem(Predicate<RadComboBoxItem>)FindItemByText(string, bool)FindItemByText(string)FindItemByValue(string, bool)FindItemByValue(string)FindItemIndexByText(string, bool)FindItemIndexByText(string)FindItemIndexByValue(string, bool)FindItemIndexByValue(string)Focus()GetCheckedIndices()GetCheckedItemsTexts()LoadContentFile(string)LoadControlState(object)LoadPostData(string, NameValueCollection)OnCheckAllCheck(RadComboBoxCheckAllCheckEventArgs)OnDataBinding(EventArgs)OnDataSourceViewSelectCallback(IEnumerable)OnInit(EventArgs)OnItemChecked(RadComboBoxItemEventArgs)OnItemCreated(RadComboBoxItemEventArgs)OnItemDataBound(RadComboBoxItemEventArgs)OnItemsRequested(RadComboBoxItemsRequestedEventArgs)OnLoad(EventArgs)OnPreRender(EventArgs)OnSelectedIndexChanged()OnTemplateNeeded(RadComboBoxItemEventArgs)OnTextChanged(EventArgs)PerformDataBinding(IEnumerable)PerformSelect()RaiseCallbackEvent(string)RaiseItemCreated(ControlItem)RaiseItemDataBound(ControlItem)RaisePostDataChangedEvent()RaisePostDataEventsIfTextIsChanged(string)RaiseSelectedIndexChandedEvent()RaiseTemplateNeeded(ControlItem)RaiseTextChandedEvent()RenderBeginTag(HtmlTextWriter)RenderBrowserSpecificStyles(HtmlTextWriter)RenderContents(HtmlTextWriter)RequiresControlState()SaveControlState()SetPostDataSelection(int)SortItems()SortItems(IComparer)EventsCheckAllCheckItemCheckedItemCreatedItemDataBoundItemsRequestedSelectedIndexChangedTemplateNeededTextChanged
Not finding the help you need?
Contact Support