CheckedListBox and multiple columns?

Posted on 2004-11-11
Last Modified: 2012-05-05
Hi All,
I want to be able to display 2 or more columns in a CheckedListBox on a windows form in addition to the checkbox column.

Specifically, my need is to allow a user to view the "Username" and "Email Address" (column1, and column 2) for a single row in the checkedlistbox and be able to check the corresponding check box for that row.

Any ideas?

Question by:colepc
    1 Comment
    LVL 1

    Accepted Solution

    I'm not sure how one would display multiple columns in the standard checkedlistbox control, so I would just concatenate the two (or more) elements into a single string to put in the box...e.g....

    checkedlistbox1.items.add( " username1 " + " user1 email address " )
    Of course, depending on how you're getting your values, you'd use arrays and/or data readers to fill the box in some sort of looping structure.  If you wanted some sort of nice alignment within the box, then you'd have to mess with using some combination of substring and trim functions to make sure everything aligned nicely.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    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