This is a migrated thread and some comments may be shown as answers.

Disable Cursor from RadComboBox

13 Answers 541 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 19 Oct 2011, 02:10 PM
I am writing to learn if there is an option to remove the blinking mouse cursor from the RadComboBox - 
without disabling the actual RadComboBox;

As of April of 2010, a post from Telerik Support indicated the cursor cannot be controlled programmatically - unless the RadComboBox is disabled;

Thanks in advance for any insight; 

Best regards - Rob

13 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Oct 2011, 05:23 AM
Hello Robert,

I suppose you want to prevent to type in RadComboBox. You could try setting AllowCustomText property of the RadComboBox to false which prevents typing any text in the input of the RadComboBox. Also set the EnableLoadOnDemand and MarkFirstMatch properties to false.

Thanks,
Shinu.
0
Accepted
Ivana
Telerik team
answered on 24 Oct 2011, 12:55 PM
Hi Robert,

It is a behavior of the input element itself. The caret would not be shown only if the input is disabled.
You could do that on the RadComboBox's input field, but then you would not get the drop down list opened when the input is clicked, it will only open when the arrow on the input's right side is clicked.

The following code snippet disables the RadComboBox's input field:
<script type="text/javascript">
    function pageLoad() {
        var combo = $find("RadComboBox1");
        var input = combo.get_inputDomElement();
        input.disabled = "disabled";
    }
</script>
<telerik:RadComboBox ID="RadComboBox1" runat="server">
    <Items>
        <telerik:RadComboBoxItem Text="item1" />
        <telerik:RadComboBoxItem Text="item2" />
    </Items>
</telerik:RadComboBox>

Regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Robert
Top achievements
Rank 1
answered on 26 Jan 2012, 05:46 AM
Is there a better solution for this?  It's pretty ugly to see that thing blinking.  And what good would it do to disable the control unless I'm not understanding?
0
Ivana
Telerik team
answered on 30 Jan 2012, 12:47 PM
Hello Robert,

The JS below, does not disable the RadComboBox control, but only its input area.
<script type="text/javascript">
    function pageLoad() {
        var combo = $find("RadComboBox1");
        var input = combo.get_inputDomElement();
        input.disabled = "disabled";
    }
</script>

I am sorry, but this really is the only workaround for this scenario at the moment, as this is entirely a behavior of the HTML input element itself when claimed as "readonly".

Greetings,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Harika
Top achievements
Rank 1
answered on 12 Apr 2012, 03:18 PM
Hello Team,

Diabling the input area throws exception when clicked on the drop down "down arrow" button second time as it tries to set focus on the control.

Any other solution to disable typing inside the dropdown

Thanks in Advance
0
Shinu
Top achievements
Rank 2
answered on 13 Apr 2012, 10:14 AM
Hello,

You can set AllowCustomText property of the RadComboBox to false which prevents typing  text in the RadComboBox.

Thanks,
-Shinu.
0
Harika
Top achievements
Rank 1
answered on 13 Apr 2012, 01:59 PM
Hello Shinu,

Thanks for the reply.

i have already tried to set AllowCustomText property. it is false by default and prevents typing the other letters which does not match the items in the dropdown list. i want to completely disable typing and allow to select only check boxes
0
Shinu
Top achievements
Rank 2
answered on 17 Apr 2012, 06:44 AM
Hello,

Try the following code to disable typing and allow to select only checkboxes.

ASPX:
<telerik:RadComboBox ID="RadComboBox5" runat="server" CheckBoxes="true">
    <Items>
        <telerik:RadComboBoxItem Text="Paris_Paris" Value="Paris" />
        <telerik:RadComboBoxItem Text="Rome_Rome" Value="Rome" />
        <telerik:RadComboBoxItem Text="London_London" Value="London" />
        <telerik:RadComboBoxItem Text="Paris_Paris" Value="Paris" />
        <telerik:RadComboBoxItem Text="Rome_Rome" Value="Rome" />
        <telerik:RadComboBoxItem Text="London_London" Value="London" />
        <telerik:RadComboBoxItem Text="Paris_Paris" Value="Paris" />
        <telerik:RadComboBoxItem Text="Rome_Rome" Value="Rome" />
        <telerik:RadComboBoxItem Text="London_London" Value="London" />
    </Items>
</telerik:RadComboBox>

JS:
<script type="text/javascript">
  function pageLoad()
    {
       var combo = $find("<%= RadComboBox5.ClientID %>");
       var input = combo.get_inputDomElement();
       input.disabled = "disabled";
    }
</script>

Please provide your full code if it doesn't helps.

Regards,
Shinu.
0
Thomas
Top achievements
Rank 1
answered on 23 Apr 2012, 05:49 AM
Disabling the input area throws exception when user click on the drop down "down arrow" button twice as it tries to set focus on the control. 

Any other solution to disable typing inside the dropdown ?

Note: it happens in IE8 and does not happen in IE9

0
Shinu
Top achievements
Rank 2
answered on 23 Apr 2012, 06:39 AM
Hi Thomas,

I tried the above code in telerik version 2012, 1, 215, 35 ,but no avail. I tried the same in telerik version 2010, 3, 1215, 20 and 2011, 2, 915, 35 and was able to reproduce error. So please try upgrading to latest version and let me know. You can refer to Updating RadControls for ASP.NET AJAX to another version or license for more information.

Thanks,
Shinu.
0
Thomas
Top achievements
Rank 1
answered on 23 Apr 2012, 06:44 AM
Hi Shinu,

I use telerik version 2012 1.411.35, but I got the error. 

However this JS fix worked for me now.

Thank you for your quick Response :)

Best Regards,
Thomas Setiabudi

$(".rcbInput").focus(function(event) {
                event.preventDefault();
                this.blur();
            });    
0
Harika
Top achievements
Rank 1
answered on 11 May 2012, 05:01 PM
Thanks Thomas!!!

Nobody understood the issue and your solution works well.
0
Matthew
Top achievements
Rank 1
answered on 30 Oct 2012, 06:36 AM
It is not working for me
$(".rcbInput").focus(function(event) {
                event.preventDefault();
                this.blur();
            });    

we are having the same error on clicking disabled combo box as well as the disabled rad time picker in iE8
Tags
ComboBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ivana
Telerik team
Robert
Top achievements
Rank 1
Harika
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Matthew
Top achievements
Rank 1
Share this question
or