Width of drop down based on width of largest row

5 posts, 0 answers
  1. RDot
    RDot avatar
    5 posts
    Member since:
    May 2009

    Posted 22 Jan 2013 Link to this post

    Hi -

     How can I make the width of my drop down be the width of the largest row in the drop down?

     Thanks,
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jan 2013 Link to this post

    Hi,

    Try setting the AutoSizeDropDownToBestFit property of RadMultiColumnComboBox to true. In this way, each time you open the drop-down, its width will be calculated based on the sum of the widths of the columns.

    Hope this helps.

    Regards,
    Shinu.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. RDot
    RDot avatar
    5 posts
    Member since:
    May 2009

    Posted 23 Jan 2013 Link to this post

    Hi Shinu -

     Thanks for your response.    This not working for me.  It makes the drop down the same width of the combo box and then my users have to scroll horizontally to see all the columns.

      I want the width of the drop down to be as large as the widest column.     This doesn't seem like a difficult thing to do.

     Thanks
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jan 2013 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    C#:
    this.radMultiColumnComboBox1.ValueMember = "ID";
    this.radMultiColumnComboBox1.DisplayMember = "Name";
    this.radMultiColumnComboBox1.DataSource = table;
    this.radMultiColumnComboBox1.AutoSizeDropDownToBestFit = false;
    this.radMultiColumnComboBox1.BestFitColumns(true, false);

    Hope this helps.

    Regards,
    Shinu.
  6. Anton
    Admin
    Anton avatar
    167 posts

    Posted 25 Jan 2013 Link to this post

    Hello Rob,

    Thank you for writing.

    I can confirm that the both provided approaches should  re-size the drop down of the RadMultiColumnComboBox to the desired width. You can read more about the RadMultiColumnComboBox in this documentation article:http://www.telerik.com/help/winforms/multicolumncombobox-overview.html

    If you continue experiencing issues, please provide a sample project that demonstrates the undesired behavior or more information, so I can investigate it and help you with it.

    Should you have any other questions, I will be glad to assist you.

    Greetings,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top
UI for WinForms is Visual Studio 2017 Ready