Q:

How can I get value in values of item of checkboxlist ? c#

I want to match the values from reader and checkbox to change selected values of item of checkboxlist. But it does not work and I don't know what to do? Thanks.
   while (reader.Read())
        {
                       CheckBoxList1.Items.FindByValue(reader["malzeme_id"].ToString()).Selected = true;
         }

I tried also,
while (reader.Read())
        {

for (int i = 0; i < CheckBoxList1.Items.Count; i++)
            {

                if (CheckBoxList1.Items[i].Value.Equals(reader["malzeme_id"].ToString()))
                {

                    CheckBoxList1.Items[i].Selected = Convert.ToBoolean( reader["isSelected"]);

                }

}

A:

This is the first thing i found when I googled how to programaticly select a item in the list.

Assuming that the items in your CheckedListBox are strings:
for (int i = 0; i < checkedListBox1.Items.Count; i++)

 {
  if ((string)checkedListBox1.Items[i] == value)
   {
    checkedListBox1.SetItemChecked(i, true);
   }
}

Or
int index = checkedListBox1.Items.IndexOf(value);

if (index >= 0)
{
  checkedListBox1.SetItemChecked(index, true);
}

This awnser was found on this post, and posted by wdavo.

