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

Width of drop down based on width of largest row

4 Answers 255 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
RDot
Top achievements
Rank 1
RDot asked on 22 Jan 2013, 04:18 PM
Hi -

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

 Thanks,

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Jan 2013, 09:42 AM
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.
0
RDot
Top achievements
Rank 1
answered on 23 Jan 2013, 03:41 PM
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
0
Shinu
Top achievements
Rank 2
answered on 24 Jan 2013, 08:49 AM
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.
0
Anton
Telerik team
answered on 25 Jan 2013, 01:05 PM
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.
Tags
MultiColumn ComboBox
Asked by
RDot
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
RDot
Top achievements
Rank 1
Anton
Telerik team
Share this question
or