Changing alignment the DropDownBox of a RadComboBox

6 posts, 0 answers
  1. Jeremy Murtishaw
    Jeremy Murtishaw avatar
    86 posts
    Member since:
    Apr 2009

    Posted 22 Jun 2009 Link to this post

    Hello,

    I'm looking to programmatically change the alignment of the dropdown box for my RadComboBox. I'd like the vertical scrollbar to align with the dropdown arrow, and the text to expand further left. Essentially have a top-right alignment instead of a top-left one.

    Thanks!
    Jeremy
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 24 Jun 2009 Link to this post

    Hi Jeremy,

    Thanks for contacting us.

    Currently, there is no direct way to set the alignment of the items in the RadComboBox drop down. However, you can use the following code snippet to achieve this programmatically:

    foreach (RadListBoxItem item in this.radComboBox1.ComboBoxElement.ListBoxElement.Items)  
    {  
        item.Children[2].Alignment = ContentAlignment.TopRight;  

    Basically, what I am doing is iterating over all items in the drop down and setting the Alignment of the ImageAndTextLayout that actually positions the text of each item.

    We can also consider exposing a property of the RadComboBox which will enable the user to set the alignment of the items within the drop down.

    Regarding the alignment of the vertical scroll bar and the drop down arrow, you can use the DropDownMinSize/DropDownMaxSize of the RadComboBox control to explicitly set the minimum width of the drop down popup.

    I hope this is helpful.

    Do not hesitate to get back to me in case you need further assistance.

    Best wishes,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jeremy Murtishaw
    Jeremy Murtishaw avatar
    86 posts
    Member since:
    Apr 2009

    Posted 24 Jun 2009 Link to this post

    Thank you for your response Deyan, however I believe I may not have been fully clear in my question.

    What you have explained how to achieve is alignment of the text for the items within the dropdown listbox. What I am trying to do is change the aligment of the listbox itself. Currently the left side of the listbox is aligned with the left side of the combobox. I would like the right side of the listbox to be aligned with the right side of the combobox, instead. Changes in dropdownwidth would then expand/contract the left hand side of the listbox.

    Thanks!
    Colin
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 30 Jun 2009 Link to this post

    Hi Jeremy,

    Yes indeed, I have misunderstood your question.

    Currently, it is not possible to explicitly define the location of the RadComboBox's Popup (I presume you would like to right-align the RadComboBox' popup form).
     
    However, we can consider allowing the user to explicitly determine the alignment of the popup in one of our next releases.

    I hope this answers your question.

    Do not hesitate to get back to me in case of further questions.

     
    Regards,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. loowool
    loowool avatar
    60 posts
    Member since:
    Sep 2006

    Posted 24 Nov 2009 Link to this post

    Dear Telerik,

    We're facing the same problem, as we have a multi-column drop down list that is opening in the wrong position when the direction is RTL. We're using the Q3/2009 version, and we need to change the position of the popup drop down list in case of RTL.

    How can we solve this problem?

    Salah A. Malaeb
    TeknoBuild
  7. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 24 Nov 2009 Link to this post

    Hi Salah,

    Thanks for writing. I was not able to reproduce this case.

    Could you please prepare a sample WinForms application that manages to reproduce the issue so that we can take a look and see how we can help.

    Please note that you will have to open a new support ticket in order to be able to upload your project.

    Thanks for your time.

    Kind regards,
    Deyan
    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready