This question is locked. New answers and comments are not allowed.
I wrote this code to add items to RadDataBoundListBox.
It works correctly, but when I scroll to the last item and then go back to the first app crashes producing not only this: "Value does not fall Within the expected range."
I've added 237 items.
// Dati.nomiDiLang <--- It's a List<string>
ObservableCollection<Grid> lstDaAddToLstLangSugg =
new
ObservableCollection<Grid>();
int
x = 0;
foreach
(
object
item
in
Dati.nomiDiLang)
{
Grid griglia =
new
Grid(); griglia.Height = 40; griglia.Width = 350; griglia.Name = x.ToString();
TextBlock labelTesto =
new
TextBlock();
labelTesto.Width = 300; labelTesto.Height = 25; labelTesto.TextWrapping = TextWrapping.NoWrap; labelTesto.FontSize = 22; labelTesto.Margin =
new
Thickness(5, -5, 0, 0);
labelTesto.Text = item.ToString(); griglia.Children.Add(labelTesto);
lstDaAddToLstLangSugg.Add(griglia); x++;
} lstLangSugg.ItemsSource = lstDaAddToLstLangSugg;
It works correctly, but when I scroll to the last item and then go back to the first app crashes producing not only this: "Value does not fall Within the expected range."
I've added 237 items.