Clear the text in a combobox with autocomplete feature on

2 posts, 0 answers
  1. Zamel
    Zamel avatar
    20 posts
    Member since:
    Aug 2012

    Posted 17 Feb 2014 Link to this post


    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.

  2. Kalin
    Kalin avatar
    1284 posts

    Posted 18 Feb 2014 Link to this post

    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.

Back to Top