Only showing first few items

5 posts, 0 answers
  1. Paul
    Paul avatar
    9 posts
    Member since:
    Dec 2011

    Posted 19 Dec 2011 Link to this post

    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?




  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Paul
    Paul avatar
    9 posts
    Member since:
    Dec 2011

    Posted 20 Dec 2011 Link to this post

    Hi Deyan

    Thanks for the reply - worked a treat :)
  5. Kate
    Kate avatar
    5 posts
    Member since:
    Apr 2012

    Posted 18 May 2012 Link to this post

    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.
  6. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 21 May 2012 Link to this post

    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 >>

Back to Top
DevCraft banner