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 6085907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:41:31+00:00 2026-05-23T11:41:31+00:00

am using the following code to bind a checkedlistbox in win form.I want to

  • 0

am using the following code to bind a checkedlistbox in win form.I want to get the value member of of checked items in checkedlistbox ?

listCollection = new List<ListItem>();
            listCollection.Add(new ListItem { text = "Manufacturer", value = "1" });
            listCollection.Add(new ListItem { text = "Dealer", value = "2" });
            listCollection.Add(new ListItem { text = "Distributor", value = "3" });
            listCollection.Add(new ListItem { text = "Trader", value = "4" });
            listCollection.Add(new ListItem { text = "Service Provider", value = "5" });
            chkListCategory.DataSource = listCollection;
            chkListCategory.DisplayMember = "text";
            chkListCategory.ValueMember = "value";
  • 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-23T11:41:32+00:00Added an answer on May 23, 2026 at 11:41 am

    I don’t know what is ListItem but I suppose it is a class that is looks like:

    public class ListItem
    {
        public string Text;
        public object Value;
    
        public ListItem(string text, object value)
        { /*...*/ }
    }
    

    So, change the DisplayMember = "text"; to "Text" and ValueMember = "value"; to "Value":

    chkListCategory.DisplayMember = "Text";//"text"; 
    chkListCategory.ValueMember = "Value";//"value";
    

    The display text at UI will be “Manufacturer, Dealer, Distributor, …”

    And the values will be “1, 2, 3, …”

    Get the value member of checked items:

    To get the values of checked items:

    //first checked item.
    var value = (chkListCategory.CheckedItems[0] as ListItem).Value;
    
    //all checked items.
    foreach (var value in chkListCategory.CheckedItems)
    {
        Console.WriteLine((value as ListItem).Value);
    }
    
    //value at any index in the chkListCategory:
    var value = (chkListCategory.Item[index] as ListItem).Value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following lines of code which is using JQTOUCH: $('#customers').bind('pageAnimationEnd', function(e, info){ if
Using the following code I get a nice formatted string: Request.QueryString.ToString Gives me something
Using the following code: Private Sub MakeMeSomeXmlBeforeRyanGetsAngry() Dim db As New MyDBDataContext Dim customer
I am using the following code to bind an image from my database (compact
I have created a socket using the following lines of code and i get
I'm using the following code to bind the users to the model [to be
I'm using the following code to detect users' key pressing, in JavaScript: $(document).bind('keydown', function
I'm using the following code to get the selected text, my question is, how
I am using the following code to fade between images in my menu items
i am fetching data using following code _.each(cardIds, function(id){ var mdc = new MdlCard({cardId:

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.