This question is locked. New answers and comments are not allowed.
I am doing something stupid with the loopinglist (I suspect) but I cannot see how to fix it.
I have code to populate the list with minute values. However, when I run it, the three items that are visible are repeated until I scroll them off the page. From that point on it all works fine. How do I initialise that initial view?
Thanks in advance, here is the code:
I have code to populate the list with minute values. However, when I run it, the three items that are visible are repeated until I scroll them off the page. From that point on it all works fine. How do I initialise that initial view?
Thanks in advance, here is the code:
List<MinSec> minSecs = new List<MinSec>(); minSecs.Add(new MinSec() { Description = "00", Value = 0 }); minSecs.Add(new MinSec() { Description = "01", Value = 1 }); minSecs.Add(new MinSec() { Description = "02", Value = 2 }); minSecs.Add(new MinSec() { Description = "03", Value = 3 }); minSecs.Add(new MinSec() { Description = "04", Value = 4 }); minSecs.Add(new MinSec() { Description = "05", Value = 5 }); minSecs.Add(new MinSec() { Description = "06", Value = 6 }); minSecs.Add(new MinSec() { Description = "07", Value = 7 }); minSecs.Add(new MinSec() { Description = "08", Value = 8 }); minSecs.Add(new MinSec() { Description = "09", Value = 9 }); minSecs.Add(new MinSec() { Description = "10", Value = 10 }); minSecs.Add(new MinSec() { Description = "11", Value = 11 }); minSecs.Add(new MinSec() { Description = "12", Value = 12 }); minSecs.Add(new MinSec() { Description = "13", Value = 13 }); minSecs.Add(new MinSec() { Description = "14", Value = 14 }); minSecs.Add(new MinSec() { Description = "15", Value = 15 }); minSecs.Add(new MinSec() { Description = "16", Value = 16 }); minSecs.Add(new MinSec() { Description = "17", Value = 17 }); minSecs.Add(new MinSec() { Description = "18", Value = 18 }); minSecs.Add(new MinSec() { Description = "19", Value = 19 }); minSecs.Add(new MinSec() { Description = "20", Value = 20 }); minSecs.Add(new MinSec() { Description = "20", Value = 20 }); minSecs.Add(new MinSec() { Description = "21", Value = 21 }); minSecs.Add(new MinSec() { Description = "22", Value = 22 }); minSecs.Add(new MinSec() { Description = "23", Value = 23 }); minSecs.Add(new MinSec() { Description = "24", Value = 24 }); minSecs.Add(new MinSec() { Description = "25", Value = 25 }); minSecs.Add(new MinSec() { Description = "26", Value = 26 }); minSecs.Add(new MinSec() { Description = "27", Value = 27 }); minSecs.Add(new MinSec() { Description = "28", Value = 28 }); minSecs.Add(new MinSec() { Description = "29", Value = 29 }); minSecs.Add(new MinSec() { Description = "30", Value = 30 }); LoopingListDataSource loopingListDataSource = new LoopingListDataSource(minSecs.Count); IEnumerator minSecEnumerator = minSecs.GetEnumerator(); loopingListDataSource.ItemNeeded += (sender, args) => { foreach (var minSec in minSecs) { LoopingListDataItem dataItem = new LoopingListDataItem(); dataItem.Text = minSec.Description; args.Item = dataItem; } }; loopingListDataSource.ItemUpdated += (sender, args) => { args.Item.Text = minSecs[args.Index].Description; }; this.radLoopingList1.DataSource = loopingListDataSource; this.radLoopingList1.SelectedIndex = 1; this.radLoopingList1.IsExpanded = true;