Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Remove an item from a list

Reply
Thread Tools

Remove an item from a list

 
 
et
Guest
Posts: n/a
 
      01-05-2006
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.


 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      01-05-2006
What type of list are you talking about, an ArrayList or a dropdown list or
something else?

"et" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2l2YSBN?=
Guest
Posts: n/a
 
      01-05-2006
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.
>
>
>

 
Reply With Quote
 
dew
Guest
Posts: n/a
 
      01-05-2006
Wonderful, the FindByValue works great! Thanks so much for you rhelp.
Sorry for being unclear, but yes I was using a listbox.


"et" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove item from STL list sam C++ 12 05-12-2005 03:02 PM
remove an item in a STL list Gunnar G C++ 9 02-09-2005 03:24 PM
remove item from list based on name Bart Nessux Python 5 05-27-2004 09:05 PM
Function to remove an item from a linked list failing ~1 out of 10,000 times Kieran Simkin C Programming 7 05-11-2004 01:32 AM
Change style of a single row of the item list of datagrid, based on a field value of current item... QUASAR ASP .Net Datagrid Control 6 01-17-2004 07:46 PM



Advertisments