Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Combobox > Input text shifts left after selection
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Input text shifts left after selection

Feed from this thread
  • Ray avatar

    Posted on Apr 6, 2011 (permalink)

    If a string longer than the visible width of the combo box is selected the text shifts to the left inside the input. When this happens the user is not able to see the beginning of the selection they made which can be confusing. Is there a way to shift the string back over to the right?

    So if I selected "This rather long phrase in the combobox" and the input section is only 10 characters long all you would see in the input box of the RadComboBox is "e combobox"

    Below is the configuration of my combobox.

    Thanks

    <telerik:RadComboBox ID="cboCompanies" Runat="server"
        OnClientItemsRequesting="GetCompanies" 
        EnableLoadOnDemand="true"
        EnableItemCaching="false"
        OnClientSelectedIndexChanged="LoadContacts"
        LoadingMessage="Loading Please Wait"
        Width="200"
        ShowToggleImage="false"
        Filter="Contains"
        Font-Names="Arial"
        Font-Size="10px"
        MarkFirstMatch="true"
        ShowDropDownOnTextboxClick="false"
        ToolTip="Type to search for a Company">
    <WebServiceSettings Method="CompanyRadComboBox" Path="~/WebServices/WebService.asmx" />

  • Dimitar Terziev Dimitar Terziev admin's avatar

    Posted on Apr 12, 2011 (permalink)

    Hello Ray,

    Could you verify which RadControls you are using, since you have picked the Classic RadComboBox in the product section for this post, but as I've noticed you have downloaded a trial version of our RadControls for ASP.NET Ajax? Moreover the declaration of the RadComboBox provided seems to be for an Ajax version of the controls, since the classic one doesn't support load on demand via web service.

    In case you are using the RadComboBox for ASP.NET Ajax, you could use the following approach to deal with the problem you are experiencing.

    As it appears from your declaration there is an event handler function for the OnClientSelectedIndexChanged event, so just add the following code snippet in it:
    if ($telerik.isIE) {
                   var textRange = sender.get_inputDomElement().createTextRange();
                   textRange.moveEnd('sentence', -100000);
     
                   textRange.moveStart("character", 0);
                   textRange.moveEnd("character", 0);
                   textRange.select();
               }

    I hope this would help you out.

    Best Regards,
    Dimitar Terziev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Combobox > Input text shifts left after selection