I need to know what is the type of every element in CheckedListBox.Items? Is it ListViewItem, Object or what?
I also want to know how can I bind a DataTable to a CheckedListBox and set every items ID and text in windows forms?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The type depends on the objects that you use to fill the checked list box. You can use a
DataTableby using the following code:In this case since you will be filling the checked list box using a
DataTabledoingthis.checkedListBox1.CheckedItemsafter checking one or more items will output anObjectCollectionwhere each item in the collection is aDataRowViewinstance.To obtain the checked items you could do: