Is there are feature which autosizes a combobox due to its content?
I guess I found something for the dropdown-width, but it would be nice to have something similar for the box itself.
Best Regards,
Matthias
1 Answer, 1 is accepted
0
Pana
Telerik team
answered on 13 Jul 2011, 08:53 AM
Hello,
The following code shows how the RadComboBox sizes itself to its selected item:
<telerik:RadComboBoxItemContent="Really Large Item"/>
<telerik:RadComboBoxItemContent="The longest one possible"/>
</telerik:RadComboBox>
</Border>
</Grid>
</Window>
However I believe this is not the autosizing you reffer to. You could always use the MinWidth, MaxWidth and Width of the combo but this is kind of obvious.
Could you possibly send us a screenshot of your combo and draw us which sizes are not correctly set?
The ComboBox will not size itself to the sizes within it's drop down because the items in the popup has no visual elements generated prior to the popup opening. Also in virtualizing mode using hundreds of items this would be serious performance hit measuring all of them to determine a RadComboBox width.
I would recommend you to just set a slightly larger width on the RadComboBox than the average RadComboBoxItem width.
Best wishes,
Pana
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!