Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Remove an item from an asp.net checkbox list at run time

Posted on 2005-04-20
2
Medium Priority
?
235 Views
Last Modified: 2008-02-01
Is it possible to remove a check box item from a checkbox list at run time?  I've tried using the Remove method of the check list controls collection object, but the Remove method expects a Control object type rather than a List Item object.  I also tried using the syntax: Controls.Remove(.Controls(index)) which did not work. I'm using asp.net v.2003 with VB.Net.
0
Comment
Question by:LloydMc
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
nayernaguib earned 900 total points
ID: 13826102
You can use:

  CheckBoxList1.Items.Remove(ListItem) or
  CheckBoxList1.Items.Remove(string)

________________

  Nayer Naguib
0
 
LVL 14

Expert Comment

by:nayernaguib
ID: 13826153
Examples:

  CheckBoxList1.Items.Remove(CheckBoxList1.Items(1)) 'removes the 2nd item
  CheckBoxList1.Items.Remove("Hello")                         'removes the item with text "Hello"

_______________

  Nayer Naguib
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question