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

RadComboBox allowCustomText cursor question

3 Answers 149 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael Arocho
Top achievements
Rank 2
Michael Arocho asked on 25 Mar 2009, 09:57 PM
I am using RAD combo box (2.8.5.0).  I have set AllowCustomText="True" & MarkFirstMatch="True", but our users are requesting the ability to click and place the cursor within the selected value of the text using their mouse, in the event that they need to change the text.  I can use the "End" key to go the end of the text and arrow back to navigate the text, but is there a way to place the cursor within the text itself by clicking?  When I click within the selected value, the entire text is highlighted.

Here is the sample code:

web.config

    <add assembly="RadComboBox.Net2, Version=2.8.5.0, Culture=neutral, PublicKeyToken=175E9829B585F1F6"/>

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register assembly="RadComboBox.Net2, Version=2.8.5.0, Culture=neutral, PublicKeyToken=175e9829b585f1f6" namespace="Telerik.WebControls" tagprefix="rad" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <rad:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="True"
            MarkFirstMatch="True" SkinsPath="~/RadControls/ComboBox/Skins" Width="150px">
            <Items>
                <rad:RadComboBoxItem runat="server" Text="One" Value="One" />
                <rad:RadComboBoxItem runat="server" Text="Two" Value="Two" />
                <rad:RadComboBoxItem runat="server" Text="Three" Value="Three" />
                <rad:RadComboBoxItem runat="server" Text="Four" Value="Four" />
                <rad:RadComboBoxItem runat="server" Text="Five" Value="Five" />
            </Items>
        </rad:RadComboBox>
   
    </div>
    </form>
</body>
</html>

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 Mar 2009, 11:57 AM
Hi Michael,

I guess that you're using RadComboBox for ASP.NET which doesn't support this functionality. I suggest you try RadComboBox for ASP.NET AJAX, it exposes EnableTextSelection property, which if set to false, prevent the highlighting of the whole text.

Best regards,
Yana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Michael Arocho
Top achievements
Rank 2
answered on 26 Mar 2009, 12:15 PM
Thanks for your reply.

At this time, we cannot upgrade these controls to the AJAX version, due to deadline constraints.  Are there any javascript workarounds that I could apply that might get me around this limitation until we can upgrade?

0
Yana
Telerik team
answered on 26 Mar 2009, 03:33 PM
Hi Michael,

You can subscribe to OnClientDropDownOpening event and try to clear the selection in its handler:

<rad:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="True"   
            MarkFirstMatch="True" Width="150px" OnClientDropDownOpening="dropDownOpening" > 

<script type="text/javascript">  
    function dropDownOpening(sender, args)  
    {     
       var inputElem = document.getElementById(sender.InputID);  
       var temptext = inputElem.value;  
       inputElem.value = "";  
       inputElem.value = temptext;  
    }  
</script> 

All the best,
Yana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Michael Arocho
Top achievements
Rank 2
Answers by
Yana
Telerik team
Michael Arocho
Top achievements
Rank 2
Share this question
or