Hi all,
I have two problems
1. I have a comma separated string values. I want to load them all into checkedlistbox as items.....HOW?
2. how do I get the itemindex of checkedlistbox, passing the text?
regards and thanks
Jeet
Checkedlist box - windows application C#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Niradhip ChakrabortyRank #429 · 5.8K reputationPosted May 21, 2009, 11:43 PM EDT
Say your strAlldata with comma separater having all the values and chkKiosks is the id for checkbox. Now split the comma separated string and put it in array.
loop through all the array element and put it into checkbox. I have used blnfound
based on requirement you can check or uncheck the checkBox.
Array arrCheckedKiosk;
arrKioskName = strAlldata.Split(',');
bool blnFound;
blnFound = false;
if (arrKioskName != null)
{
foreach (object obj in arrKioskName)
{
chkKiosks.Items.Add(obj.ToString(), blnFound);
}
}
You can get the itemIndex like below.
for (int i = 0; i < chkKiosks.Length; i++)
{
string x = chkKiosks.GetValue(i).ToString()
}