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

Disable blinking cursor

11 Answers 157 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dirk Eberhardt
Top achievements
Rank 1
Dirk Eberhardt asked on 19 Oct 2009, 06:29 AM
Good morning,
is there a way to disable the blinking cursor at the end of the ComboBox select Box?

See attached a example image.

Thanks in advance.

Regards
Dirk

11 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 19 Oct 2009, 08:48 AM
Hello Dirk,

I hope you do not want to allow typing into your combobox input. If so, inorder to remove the cursor from the input box of the RadComboBox, make sure that the AllowCustomText and MarkFirstMatch properties of the combobox are set to false.

Thanks
Princy.
0
Dirk Eberhardt
Top achievements
Rank 1
answered on 19 Oct 2009, 08:57 AM
Hi,
i set both properties to "false", but the cursor is still there?

This is the code of my ComboBox:

<telerik:RadComboBox ID="CategoryGroup" AllowCustomText="false" MarkFirstMatch="false" runat="server" DataValueField="GROUP_CODE" DataTextField="DESCRIPTION" AutoPostBack="true" OnSelectedIndexChanged="CategoryGroup_SelectedIndexChanged" Width="100%"
</telerik:RadComboBox> 

Any other ideas?

Regards
Dirk
0
Dirk Eberhardt
Top achievements
Rank 1
answered on 21 Oct 2009, 05:59 AM
No idea?
0
jon *
Top achievements
Rank 1
answered on 10 Dec 2009, 02:02 PM
Hello,

I have the same problem, have you resolved it?

If yes, can you tell me the solution?

Thank you.
0
Dirk Eberhardt
Top achievements
Rank 1
answered on 10 Dec 2009, 02:09 PM
Hi,
no I found no solution. It's still there.
0
Cezar
Top achievements
Rank 1
answered on 29 Jun 2011, 07:52 AM
Hi everyone!

Today I stepped onto the same problem, but good news! I found a solution after a couple of minutes.

Telerik personel said that was IMPOSSIBLE on another thread! I say different!

Just add this to your ComboBox instance and you're done!

instance.OnClientDropDownOpening = "function(sender, args){sender._inputDomElement.blur();}";
instance.OnClientDropDownOpened = "function(sender, args){sender._inputDomElement.blur();}";
instance.OnClientDropDownClosed = "function(sender, args){sender._inputDomElement.blur();}";
instance.OnClientDropDownClosing = "function(sender, args){sender._inputDomElement.blur();}";

I tested here and it works just fine.

If you (like me) likes to inherit Telerik's classes so your coding would be better, your class implementation should look like this:
public class MyComboBox : Telerik.Web.UI.RadComboBox
{
    public MyComboBox()
    {
        this.OnClientDropDownOpening = "function(sender, args){sender._inputDomElement.blur();}";
        this.OnClientDropDownOpened = "function(sender, args){sender._inputDomElement.blur();}";
        this.OnClientDropDownClosed = "function(sender, args){sender._inputDomElement.blur();}";
        this.OnClientDropDownClosing = "function(sender, args){sender._inputDomElement.blur();}";
    }
}

I simply LOVE javascript! I always tell people, there's NOTHING that you CAN'T DO with javascript!
Sometimes you don't know how to do it, but fortunately you CAN.

Thanks everyone!
0
Tony
Top achievements
Rank 1
answered on 19 Sep 2011, 10:27 PM
This fix does not appear to (FULLY) work.  If you expand the combobox and then click back in the textbox portion of it, the cursor will appear.
0
Cezar
Top achievements
Rank 1
answered on 19 Sep 2011, 10:40 PM
Not for me.
Here this sample is working just fine.

Which browser are you using and which version?

Thanks!
0
Tony
Top achievements
Rank 1
answered on 19 Sep 2011, 10:53 PM
I'm using IE9, latest (9/15/11) Telerik version.  Basically the steps to reproduce are this:

1) You expand the dropdown portion.  This causes the client side Opening and Opened events to fire, which blur away the cursor.
2) With the dropdown still opened, click in the textbox portion of the combobox.  (The dropdown doesn't automatically close in this case). The cursor appears, which seems expected becasue it will not be blurred again until the closing/closed events fire.
0
Munna
Top achievements
Rank 1
answered on 20 Jun 2012, 11:21 AM
function DisableCursorInCombo() {
        var combo = $find("--Your Combo Box Id--");
        var input = combo.get_inputDomElement();
        input.disabled = "disabled";
    }

Use the above mentioned script onclientload event in your combo box. 
0
RANI
Top achievements
Rank 1
answered on 03 Sep 2015, 05:17 PM

Hi Munna, 

I used ur method with some change OnClientDropDownClosed="DisableCursorInCombo"

function DisableCursorInCombo() {
       var combo = $find('<%= rcbDynamicContentSegements.ClientID %>');
       var input = combo.get_inputDomElement();
       input.blur()
   }‚Äč

Tags
ComboBox
Asked by
Dirk Eberhardt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Dirk Eberhardt
Top achievements
Rank 1
jon *
Top achievements
Rank 1
Cezar
Top achievements
Rank 1
Tony
Top achievements
Rank 1
Munna
Top achievements
Rank 1
RANI
Top achievements
Rank 1
Share this question
or