RadMultiColumnComboBox How to Clear Text

1 Answer 295 Views
MultiColumnComboBox
Tyler
Top achievements
Rank 1
Tyler asked on 09 May 2023, 09:57 PM

I have a RadMultiColumnComboBox with AutoCompleteMode="Search". If I type "asdf" into the combo box, close the dropdown without actually selecting an item, and then refresh the page I want to clear "asdf", but I cannot figure out how to clear this text. I have tried setting the selected Item to null, setting AutoCompleteProvider.SearchText to an empty string, and setting the selected index to -1. 

What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 10 May 2023, 06:38 AM

Hello Tyler,

To clear the search text, you can use the AutoCompleteProvider property of the control. This will allow you to set the SearchTexta and MatchText which is going to affect the UI.

this.multiColumnComboBox.AutoCompleteProvider.SearchText = string.Empty;
this.multiColumnComboBox.AutoCompleteProvider.MatchText = string.Empty;

Note that the AutoCompleteProvider is null until the ItemsSource or the Columns are assigned.

I hope that helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tyler
Top achievements
Rank 1
commented on 10 May 2023, 02:09 PM

Thank you, this worked. 
Tags
MultiColumnComboBox
Asked by
Tyler
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or