How can I prevent the editor from line breaking when the selected item in the combobox fills out the whole (or more) width of the combobox editor? I want it to keep the height of a single line and just scroll the text, like in a single line textbox.
2 Answers, 1 is accepted
answered on 19 May 2022, 03:04 PM
To achieve your requirement, you can replace the default items panel of the control. You can do this using the following approach:
privatevoidRadMultiColumnComboBox_Loaded(object sender, RoutedEventArgs e)
var mccb = (RadMultiColumnComboBox)sender;
var itemsControl = mccb.FindChildByType<SearchAutoCompleteBoxesItemsControl>();
itemsControl.ItemsPanel = this.Resources["stackPanelTemplate"] as ItemsPanelTemplate;
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Actually I kind of found a solution: When setting the "SelectionBoxesVisibility" property to "Collapsed", the behavior of the control is pretty close to the desired behavior.
Unfortunately, the editor textbox (a RadWatermarkTextBox as I understand it after looking at the control templates) doesn't update to the selected item (through DisplayMemberPath), when the SelectedItem is changed through the data binding source. When changing it through the UI by typing or selection in the DropDown, it changes the displayed text correctly however.
It seems I can force it by subscribing to SelectionChanged/Loaded events and retrieving the RadWatermarkTextBox through FindChildByType and then setting the Text manually but this is kind of messy and not very elegant.
It would be nice if the RadWatermarkTextBox reacted to the changes in the data binding source.