This is a migrated thread and some comments may be shown as answers.

Clear the text in a combobox with autocomplete feature on

1 Answer 110 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Zamel
Top achievements
Rank 1
Zamel asked on 17 Feb 2014, 01:55 PM
Hello,

I am trying to clear the text in the combobox with autocomplete feature but with no luck? So, in our page we have this functionality that can scan a barcode. I'm catching the keyup for the whole page and then reset the values in the control where the focus is on. When it is in the combobox, I cannot get the text cleared. My barcode indicator is this symbol: ]

Whenever my focus is on the combobox, it is being left there. I tried to hookup with the keyup event of this control, but I still cannot clear what has been written in the textbox. I did:

var textbox = this.combobox.FindChildrenOfType<TextBox>();
if (textbox != null)
textbox.Text = string.Empty;


Is there any other way I can clear the text??? Please advise.


Thanks,
Zamel

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 18 Feb 2014, 04:12 PM
Hello Zamel,

Did you try setting the Text property of the ComboBox to null? It should remove the entered text. Please give a try and if it doesn't work for you I'll ask you to share some sample code which demonstrates the ComboBox setup.

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
Tags
ComboBox
Asked by
Zamel
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or