Disable Cursor from RadComboBox

14 posts, 2 answers
  1. Robert
    Robert  avatar
    68 posts
    Member since:
    Feb 2009

    Posted 19 Oct 2011 Link to this post

    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
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Oct 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 24 Oct 2011 Link to this post

    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
  5. Robert
    Robert avatar
    13 posts
    Member since:
    Aug 2011

    Posted 25 Jan 2012 Link to this post

    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?
  6. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 30 Jan 2012 Link to this post

    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
  7. Harika
    Harika avatar
    9 posts
    Member since:
    Mar 2012

    Posted 12 Apr 2012 Link to this post

    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
  8. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Apr 2012 Link to this post

    Hello,

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

    Thanks,
    -Shinu.
  9. Harika
    Harika avatar
    9 posts
    Member since:
    Mar 2012

    Posted 13 Apr 2012 Link to this post

    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
  10. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Apr 2012 Link to this post

    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.
  11. Thomas
    Thomas avatar
    2 posts
    Member since:
    Apr 2012

    Posted 23 Apr 2012 Link to this post

    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

  12. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Apr 2012 Link to this post

    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.
  13. Thomas
    Thomas avatar
    2 posts
    Member since:
    Apr 2012

    Posted 23 Apr 2012 Link to this post

    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();
                });    
  14. Harika
    Harika avatar
    9 posts
    Member since:
    Mar 2012

    Posted 11 May 2012 Link to this post

    Thanks Thomas!!!

    Nobody understood the issue and your solution works well.
  15. Matthew
    Matthew avatar
    13 posts
    Member since:
    Jan 2012

    Posted 30 Oct 2012 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017