Hello,
I am having an issue with RadMultiColumnComboBox. I am having to set to a large width for them to not line wrap. When I select an item it is doing this:
How can I prevent it from doing this? The width is more than twice the size of the largest element, and it is set to single select so there is no reason to wrap the text.
Would it be possible to check the suggestions provided by Martin in the following forum thread regarding this inquiry?
RadMultiColumnComboBox: How can I prevent the ComboBox Editor from line breaking/word wrapping? in UI for WPF | Telerik Forums
Hi Renly,
Yes I tried replacting default items panel of the control. This unfortunately does not work. It just increases the width of the selection box to match the width of the control, but it still wraps. The workaround provided is to just set the SelectionBoxesVisibility to Collapsed, but that is not an acceptable workaround for us.
Hello Tyler,
Since both of these approaches do not prevent this behavior from occurring, you can follow the last posted comment from the initial answer from Martin (posted on 25 May 2022, 10:22 AM). It consists of modifying the default control template of the SearchAutoCompleteBox element that is part of the RadMultiColumnComboBox's default control template. The comment also contains a sample project that you can test.
Hi Renly,
The comment you are referencing does not work either. If you open the project Martin posted in the comment and set SelectionBoxesVisibility="Visible" and set the height to 25 the wrapping behavior does the same thing. It does work correctly when you programmatically set SelectedItem, but if you select a dropdown item it does not.
The EditorMinWidth property of RadMultiColumnComboBox control controls the MinWidth property of the RadWatermarkTextBox element, which is present in its default control template.
I also tested setting this property and the unwanted behavior is no longer present on my end. The following snippet shows the modified definition of the RadMultiColumnComboBox control from the sample application that you provided:
<telerik:RadMultiColumnComboBox x:Name="cmbTest" VerticalAlignment="Center" EditorMinWidth="0" DisplayMemberPath="Name" Height="25" Width="120"> <telerik:RadMultiColumnComboBox.ItemsSourceProvider> <telerik:GridViewItemsSourceProvider /> </telerik:RadMultiColumnComboBox.ItemsSourceProvider> </telerik:RadMultiColumnComboBox>
Setting this property should not result in any issues, however, if you meet any, please let me know.