Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a checkedListBox Control,Where i have filled Some value from database.
When I checked any item of the CheckedListBox control, I need the Selected value.

Below is the code for the same, Please support...
C#
 List<object> fields = new List<object>();
foreach (object itemChecked in chklbSection.CheckedItems)
                {
                    DataRowView drv = itemChecked as DataRowView;

                               
                    fields.Add(itemChecked);
                    fields.ToString();


                }

How can i get the Selected value from List object
Posted
Updated 17-Oct-13 7:38am
v2

You need to check this Tutorial[^] especially concentrate on this line:

C#
this.Text = checkedListBox1.Items[selected].ToString();


And also should follow:
how to get value of checked item from checkedlistbox[^]
 
Share this answer
 
You should use
SelectedItem.Text property if you want Text and
SelectedValue property if you want the Value.

Please see the below link for more details
http://www.w3schools.com/aspnet/showaspx.asp?filename=demo_checkboxlist[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900