Remove an item from an checkbox list at run time

Posted on 2005-04-20
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 v.2003 with VB.Net.
Question by:LloydMc
    LVL 14

    Accepted Solution

    You can use:

      CheckBoxList1.Items.Remove(ListItem) or


      Nayer Naguib
    LVL 14

    Expert Comment


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


      Nayer Naguib

    Featured Post

    Course: HTML5 Mobile App Development with PhoneGap

    PhoneGap can help you leverage your already existing HTML5, JavaScript, and CSS skills in order to create and deploy cross-platform mobile apps.This program comprehensively covers HTML5 mobile app development from top to bottom.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    linearIn  challenge 23 54
    array6 challenfge 6 48
    mapBully challenge 6 53
    wordmultiple challenge 12 63
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now