RadComboBox for ASP.NET

The AssociatedControlID property of asp:Label has no effect on Telerik RadComboBox Send comments on this topic.
TroubleShooting > The AssociatedControlID property of asp:Label has no effect on Telerik RadComboBox

Glossary Item Box

Telerik RadComboBox is a composite control consisting of an input area, dropdown and dropdown image. Therefore, the AssociatedControlID property of the Label control cannot automatically detect which part of the combobox should be focused.
There is, however, a relatively easy workaround with a few lines of javascript. Just define your label and the combobox and after their declaration add the following javascript code:

Example:

ASPX Copy Code
<asp:Label
   
ID="Label1"
   
runat=server
   
AccessKey="O"
   
AssociatedControlID="RadComboBox1"
   
Text="<u>E</u>nter Text:">
</
asp:Label>
<
radcb:RadComboBox
   
id="RadComboBox1"
   
Runat="server"
   
AllowCustomText="True">
</
radcb:RadComboBox>
  Copy Code
<script type="text/javascript">
   
var comboBoxInstance = <%= RadComboBox1.ClientID %>
   
var comboBoxInputElement = document.getElementById(comboBoxInstance.InputID);
   var labelElement
= document.getElementById("<%= Label1.ClientID %>");
   labelElement.htmlFor
= comboBoxInputElement.id;
</script>