Link to home
Start Free TrialLog in
Avatar of LloydMc
LloydMc

asked on

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

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.
ASKER CERTIFIED SOLUTION
Avatar of nayernaguib
nayernaguib
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Examples:

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

_______________

  Nayer Naguib