0

Hi,
I am create one application in which i use checkedlistbox. In checkedlist box i display all employee name and calculate id of particular checked employees. but how to check which employee's name checked in checked list box and how to compare this employee is checked or selected.

Regards,
shailaja

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sanch01r
0

Found an old example. I am not sure if this will help out entirely but it should convey the general idea. You can retrieve the selected item value and /or the checklisted item alone, I created a form with a checklistbox, and two listboxes titled listbox1 and listbox2. Listbox1 one displays the selected item, and listbox2 displays all checked items. Here is the code snippet.

private void btnGetNames_Click(object sender, EventArgs e)
        {
            
            listBox1.Items.Add(checkedListBox1.Text); //adds only the selected item to listbox.


            for (int i = 0; i < checkedListBox1.CheckedItems.Count; i++)
            {
                listBox2.Items.Add(checkedListBox1.CheckedItems[i]); //adds only the checked items to listbox.
            }           
 

            

        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.