remove an item from a dropdownList

Discussion in 'ASP .Net Web Controls' started by Patrick Beaudoin, Aug 4, 2003.

  1. Hello Adil,
    this is my suggestion:

    1-
    drdMedicine.Items.Add(New ListItem("All", "0"))
    drdMedicine.Items.Remove(New ListItem("All", "0"))

    2-
    drdMedicine.Items.Add("All")
    drdMedicine.Items.Remove(New ListItem("All")

    >-----Original Message-----
    >Hi all,
    >
    >I'm using a dropdownlist to store some data. in the

    page_load function i
    >added an default item by this function
    >drdMedicine.Items.Add(New ListItem("All", "0"))

    drdMedicine.SelectedValue = 0
    >
    >but if the user clicks a button (named ibtNew), this

    item should be removed,
    >i tried this function but it's not working,
    >
    >drdMedicine.Items.Remove("All")
    >
    >
    >
    >can someone help me please,
    >
    >thanks in advance,
    >
    >Adil
    >
    >
    >.
    >
    Patrick Beaudoin, Aug 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ssoss

    Display Related Item or Add Item

    ssoss, Sep 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    477
    ssoss
    Sep 19, 2003
  2. gce

    Tabstrip with remove item

    gce, Mar 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,264
    Jason Bentley
    Mar 28, 2005
  3. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,345
    Henrik
    Aug 10, 2005
  4. et

    Remove an item from a list

    et, Jan 5, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    5,730
  5. Kylin

    How to Remove item from DropDownList ?

    Kylin, Apr 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    132
    Angrez Singh
    Apr 25, 2005
Loading...

Share This Page