0

I got this

foreach (string itemm in member.getProperty("categories").Value.ToString().Split(','))
{
     Cbl_items.SelectedValue = itemm;
}

And this only makes the last "itemm" selected , how can i do this for 3 or 4 ?

4
  • 1
    what is cbl_items? You are asigning itemm to selected value in every step of the cycle, not adding, thats why only last one is selected Commented Apr 29, 2014 at 11:40
  • 1
    possible duplicate of Check multiple items in ASP.NET CheckboxList Commented Apr 29, 2014 at 11:42
  • cbl_items is the ID of the checkboxlist guys Commented Apr 29, 2014 at 11:43
  • @Uriel_SVK thank you SIR! that helped a lot , just replaced the content inside the foreach to: Cbl_items.Items.FindByValue(itemm).Selected = true; Commented Apr 29, 2014 at 11:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.