Remove an item from a list

Discussion in 'ASP .Net' started by et, Jan 5, 2006.

  1. et

    et Guest

    How do I remove an item from a list by its value?

    I tried lst.items.Remove("Client1"), but it didn't remove the item.
    et, Jan 5, 2006
    #1
    1. Advertising

  2. What type of list are you talking about, an ArrayList or a dropdown list or
    something else?

    "et" <> wrote in message
    news:%...
    > How do I remove an item from a list by its value?
    >
    > I tried lst.items.Remove("Client1"), but it didn't remove the item.
    >
    Peter Rilling, Jan 5, 2006
    #2
    1. Advertising

  3. Try this:

    lst.Items.Remove (lst.Items.FindByValue ("Client1"));

    "et" wrote:

    > How do I remove an item from a list by its value?
    >
    > I tried lst.items.Remove("Client1"), but it didn't remove the item.
    >
    >
    >
    =?Utf-8?B?U2l2YSBN?=, Jan 5, 2006
    #3
  4. et

    dew Guest

    Wonderful, the FindByValue works great! Thanks so much for you rhelp.
    Sorry for being unclear, but yes I was using a listbox.


    "et" <> wrote in message
    news:%...
    > How do I remove an item from a list by its value?
    >
    > I tried lst.items.Remove("Client1"), but it didn't remove the item.
    >
    dew, Jan 5, 2006
    #4
    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. Gunnar G

    remove an item in a STL list

    Gunnar G, Feb 8, 2005, in forum: C++
    Replies:
    9
    Views:
    642
    Pete Becker
    Feb 9, 2005
  2. sam
    Replies:
    12
    Views:
    9,571
    Mike Wahler
    May 12, 2005
  3. Kieran Simkin
    Replies:
    7
    Views:
    377
    Kieran Simkin
    May 11, 2004
  4. Bart Nessux

    remove item from list based on name

    Bart Nessux, May 27, 2004, in forum: Python
    Replies:
    5
    Views:
    472
    Larry Bates
    May 27, 2004
  5. Jonathan
    Replies:
    6
    Views:
    410
    Jonathan
    Mar 14, 2006
Loading...

Share This Page