Question

We have a Telerik ASP.net AJAX RadComboBox with CheckBoxes set true. The drop down stays open after checking a checkbox so you can check more, which is fine. The problem is that when you click in a textbox while the dropdown is open an entry cursor appears in the textbox briefly as it gets focus but clears as the textbox loses focus when the combobox dropdown closes. It is necessary to click the textbox a second time before typing into it. Alternatively the combobox dropdown button must first be clicked to close the dropdown before clicking the textbox to transfer the focus.

Is there some way to prevent the combobox from retaining the focus when another control is clicked? I have tried removing all attributes from the control besides the following and the problematic behaviour persists.

<telerik:RadComboBox ID="ToVehicleSelector" runat="server" CheckBoxes="True">
</telerik:RadComboBox>
Was it helpful?

Solution

I received feedback on the Telerik forum that put me on the right track and helped me to figure out a workaround to the problem. I added a click handler to the text boxes as shown below.

<script language="javascript" type="text/javascript">
  function ForceFocus(textbox) {
    $get(textbox).focus();
  }
</script>

<asp:TextBox ID="SubjectTextBox" runat="server" Width="300" onkeydown="OnMessageKeyDown()"
  onkeyup="OnMessageKeyUp()" onclick="ForceFocus('SubjectTextBox')">
</asp:TextBox>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top