Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3999586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:40:35+00:00 2026-05-20T07:40:35+00:00

I have a checkboxlist in C# that is databound from the database. What I

  • 0

I have a checkboxlist in C# that is databound from the database. What I would like to do is display an icon on the right side after the text for each of the checkboxlist items. Each icon needs to be different though. Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:40:35+00:00Added an answer on May 20, 2026 at 7:40 am

    You could do something like this

    <asp:CheckBoxList ID="CheckBoxList1" runat="server"
    DataSourceID="dataSourceID"
    DataTextField="dataTextField"
    DataValueField="dataTextValue"
    OnDataBound="CheckBoxList1_DataBound">
    </asp:CheckBoxList>
    
    protected void CheckBoxList1_DataBound(object sender, EventArgs e)
    {
        var checkBox = sender as CheckBoxList;
        if(checkBox != null)
        {
            foreach (ListItem listItem in checkBox.Items)
            {
                listItem.Text = string.Format("{0}<img src='{1}' />", listItem.Text, GetImageFor(listItem.Text));
            }
        }
    
    }
    
    private string GetImageFor(string text)
    {
        // return image url for check box based on text.
    
        if(text.Equals("Banana")) return "banana.gif";
        ...
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CheckboxList that seems to load and do everything right, except for
I have an ASP.NET server control that inherits from CheckBoxList that renders the controls
I have some checkboxlist like this: <asp:CheckBoxList ID=G1 runat=server> <asp:ListItem Value=Comunicações Unificadas Text=Comunicações Unificadas
I have an asp.net panel that contains a checkboxlist. I'd like to resize it
Hey, I have a CheckBoxList that gets populated with the database. When I make
I have a CheckBoxList that displays a list of checkboxes using data from a
I have a checkboxlist wich contains a list of services loaded from a database
I have a Repeater control that is creating a dynamic amount of CheckBoxList controls
I have a web based program which chooses some records from a database using
i have a CheckBoxList with a list of services that the user can execute...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.