Alignment of wide text in RadComboBox

2 posts, 0 answers
  1. Kevin Meyer
    Kevin Meyer avatar
    36 posts
    Member since:
    Dec 2007

    Posted 14 Feb 2008 Link to this post

    I have a requirement to left-align text in combo boxes, even if the text flows past the width of the control.  Q3 2007 SP1 defaults to showing item text right-aligned if overflowing the control.  Is there a setting to change this?

    This behavior can be seen in the First Look (My Tunes) demo.  Choose Artist: "Sting", Album: "Brand New Day", Song: "7. Prelude To The End Of The Game".  Notice the song combo box reads "e To The End Of The Game" after losing focus.

    Thanks!
  2. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 15 Feb 2008 Link to this post

    Hi Kevin Meyer,

    Unfortunately, the RadComboBox has been designed to behave in such a way. Currently, there is no way to change the behavior through the API. We are aware of this issue and it is in our TODO list. However, to avoid this behavior, I would suggest the following workaround :

    private void radComboBox1_DropDownClosed(object sender, Telerik.WinControls.UI.RadPopupClosedEventArgs args)

        radComboBox1.SelectionLength = 0;
    }

    Setting SelectionLength to 0 will remove the selection, but will set the textbox caret in the beginning of the text.
    This you could also do when the Up/Down key is pressed to handle the case when the user uses the arrow keys to select an item.

    If you have any additional questions, please write us again.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top