Value does not fall within the expected range

This might be due to the fact that you are trying to add a ListBoxItem with the same name to the page.

If you want to refresh the content of the listbox with the newly retrieved values you will have to first manually remove the content of the listbox other wise your loop will try to create lb_1 again and add it to the same list.

Look here for a similar problem that occurred Silverlight: Value does not fall within the expected range exception

Leave a Comment