This is a migrated thread and some comments may be shown as answers.

Only showing first few items

4 Answers 88 Views
LoopingList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 19 Dec 2011, 05:14 PM
Hi,

I am using a horizontal looping listbox to show images in my app.

The phones screen limits the number of images shown at anyone time to just three which is fine. I have 8 images in total.

The problem is, the looping list only seems to load the first 4 images and then repeats these for the next four. i.e. it will show images 0,1,2,3,0,1,2,3  instead of 0,1,2,3,4,5,6,7

I have checked and all images are set to content and copy if newer.

Here is my code:

ds =

 

New LoopingListDataSource(8)

 

 

 

AddHandler ds.ItemNeeded, AddressOf ds_ItemNeeded

 

 

 

AddHandler ds.ItemUpdated, AddressOf ds_ItemUpdated

 

loopingList.DataSource = ds


 

 

' // Looping List Item Updated

 

 

 

Private Sub ds_ItemUpdated(sender As Object, e As LoopingListDataItemEventArgs)

 

 

 

    DirectCast(e.Item, MyImage).Uri = "/Icons/Select/" + e.Index.ToString + ".png"

 

 

 

End Sub

 

 

 

' // Looping List Item Needed

 

 

 

Private Sub ds_ItemNeeded(sender As Object, e As LoopingListDataItemEventArgs)

 

 

 

    Dim img As MyImage = New MyImage

 

    img.Uri =

 

"/Icons/Select/" + e.Index.ToString + ".png"

 

    e.Item = img

 

 

End Sub

 


My images are names 0.png - 7.png

Can anyone help?




4 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 20 Dec 2011, 08:22 AM
Hello Paul,

Thanks for writing and for the provided code snippet.

Please make sure that your class, MyImage, implements the INotifyPropertyChanged interface and fires the PropertyChanged event when the Uri property is set with a value different from the current one.

This should fix the issue for you.

Let me know if you need further assistance here.

Regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Paul
Top achievements
Rank 1
answered on 20 Dec 2011, 10:33 AM
Hi Deyan

Thanks for the reply - worked a treat :)
0
Kate
Top achievements
Rank 1
answered on 18 May 2012, 04:28 PM
Can you provide a simple example of how to do this?  It's not working for me at all, I either lose the contents of my loopinglist or nothing happens.
0
Deyan
Telerik team
answered on 21 May 2012, 08:39 AM
Hi Kate,

Please refer to the other forum post you have created regarding the same case.

Do not hesitate to get back to us in case you need further assistance.

Greetings,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
LoopingList
Asked by
Paul
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Paul
Top achievements
Rank 1
Kate
Top achievements
Rank 1
Share this question
or