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

[Solved] Selected Text Issue in Internet Explorer

3 Answers 112 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nick Elliott
Top achievements
Rank 1
Nick Elliott asked on 02 Dec 2009, 04:16 PM
Hi

I've had a search trhough the forums and haven't found an answer to this, so aapologies if it's been asked already.

I have a ComboBox which has some long values in it.  The width of the combo restricts what has been selected (you can see aprox. 16 characters of the selection).  This is ok because the selections in the dropdown wrap nicely, so the user can see all of the text what they have selecting.

My problem is once a user selects an opiton.  In Firefox, Chrome and Safari the selection shows the 1st 16 characters and in Internet Explorer it shows the last 16 characters.  I would normally let this go, but our QA department are admanant that the text at the start of the selection should be shown in ALL browsers.

To illustrate I've got the following option in my Combo Box - 'This is a very long option - I need to show the first 16 characters'

In IE I'm getting 'st 16 characters' showing in the seleced box, whereas
In Firefox I'm getting 'This is a very lo' showing in the selected box - this is the preferred option.

If anyone has any ideas how I can get around this, it'd be much appreciated. I hope I've explained this ok!

Thanks for your time

3 Answers, 1 is accepted

Sort by
0
Tim Hardy
Top achievements
Rank 1
answered on 03 Dec 2009, 10:49 AM
+1 on this. I also have the same problem.

I've found the following discussion for the Winforms version of the control - http://www.telerik.com/community/forums/winforms/combobox/text-alignment-in-radcombobox.aspx - but not an answer for the RadControls for ASP.NET AJAX ComboBox. 


0
Simon
Telerik team
answered on 09 Dec 2009, 04:07 PM
Hi guys,

Thank you for letting us know about the issue.

In actuality this is the default browser behavior. Although the cursor is positioned at the *end* of the input in all browsers only IE shows the end of the text whereas the others - the beginning. Nevertheless we will consider ways of working this around and position the cursor at the beginning of the input in future versions of RadComboBox.

In the meanwhile you can handle the client-side SelectedIndexChanged event and manually move the cursor at the beginning of the input:

function onSelectedIndexChanged(sender, eventArgs) {
    sender.selectText(0, -sender.get_text().length);
}

Regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tim Hardy
Top achievements
Rank 1
answered on 11 Dec 2009, 08:00 PM
Hi Simon

Many thanks for the workaround. Much appreciated.
Tags
ComboBox
Asked by
Nick Elliott
Top achievements
Rank 1
Answers by
Tim Hardy
Top achievements
Rank 1
Simon
Telerik team
Share this question
or