Pppulate checkboxlist from a set of avlues

Posted on 2007-10-10
Last Modified: 2013-12-17
I need a checkboxlist to be populated from a DataTable /ArrayList.

The data is not pulled from the database.It is a set of hardcoded values. Where is the best place to put the hardcoded values.One place might be web.config .But is there any other better solution
Question by:Bkuniyil
    LVL 9

    Accepted Solution

    You could set the values in the OnLoad event of the CheckBoxList, like so:

    Public Sub cbl1_load(ByVal sender As Object, ByVal e As System.EventArgs)

        End Sub

    Does that help?
    LVL 16

    Assisted Solution

    With this XML file:
    <?xml version="1.0" encoding="utf-8" ?>
    <item value="1" text="Value 1" />
    <item value="2" text="Value 2" />
    <item value="3" text="Value 3" />

    And this code:
    <asp:CheckBoxList ID="CheckBoxList1" runat="server"
    DataTextField="text" DataValueField="value">
    </asp:CheckBoxList><asp:XmlDataSource ID="XmlDataSource1" runat="server"

    I got this from....
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    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…

    779 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

    12 Experts available now in Live!

    Get 1:1 Help Now