RadMultiColumnComboBox Line Wrapping Unnecessarily

0 Answers 24 Views
MultiColumnComboBox
Tyler
Top achievements
Rank 1
Tyler asked on 25 Oct 2023, 04:11 PM

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.

Tyler
Top achievements
Rank 1
commented on 27 Oct 2023, 03:24 PM

I am attaching an example project that shows the issue. 
Stenly
Telerik team
commented on 30 Oct 2023, 11:56 AM

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

Tyler
Top achievements
Rank 1
commented on 30 Oct 2023, 01:18 PM

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.

Stenly
Telerik team
commented on 31 Oct 2023, 04:47 PM

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.

 

Tyler
Top achievements
Rank 1
commented on 31 Oct 2023, 06:56 PM

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.

 

Tyler
Top achievements
Rank 1
commented on 31 Oct 2023, 07:31 PM

After messing around with editing the control template, if I lower the EditorMinWidth the wrapping goes away. Will editing this cause any issues?
Stenly
Telerik team
commented on 03 Nov 2023, 04:05 PM

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.

No answers yet. Maybe you can help?

Tags
MultiColumnComboBox
Asked by
Tyler
Top achievements
Rank 1
Share this question
or