Combobox items clear?

  1. #1

    Combobox items clear?

    Hi,
    How to clear a combobox selected item.
    combbox.items.clear(). is not working.
    please help me.
  2. #2
    Try combo.store.data.clear();
    It worked for me.
  3. #3
    I figured this out. I thought this code maybe helpful for someone in the same situation coming across this thread.

    To Clear:
    ComboBox1.GetStore().RemoveAll();
    To Add new Items:
    ComboBox2.AddItem("Test" + DateTime.Now.ToString(), "Test");
    Not sure why you can't use but you can't
    ComboBox2.Items.Add(new ListItem("Test" + DateTime.Now.ToStirng(), "Test");
    The call above works on Page Load but not in a Direct Event not sure why.

    ~Nick
    Last edited by Nikoli; Oct 06, 2011 at 2:38 PM.

Similar Threads

  1. Replies: 1
    Last Post: Apr 27, 2012, 11:53 AM
  2. [CLOSED] Clear combobox list items in the code behind
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 24, 2011, 3:17 PM
  3. Replies: 1
    Last Post: Jul 21, 2010, 9:11 PM
  4. Clear Items from Multiselect
    By jxlarrea in forum 1.x Help
    Replies: 0
    Last Post: Aug 13, 2009, 1:20 PM
  5. Clear combobox in v8.0
    By onurbozkurt in forum 1.x Help
    Replies: 0
    Last Post: Jun 11, 2009, 3:12 AM

Tags for this Thread

Posting Permissions