ImageGallery Item Accessing ImageURL

2 posts, 0 answers
  1. Min
    Min avatar
    1 posts
    Member since:
    Oct 2013

    Posted 29 Sep 2014 Link to this post

    I am trying to preload the full images retrieved from a database and bound to the ImageGallery control to cache the images in the browswer and help improve our user experience using javascript. 

    I have tried access the image url by getting the RadImageGalleryItems collection and then call get_imageUrl for each item in the array on the OnImageGalleryCreated client-side event.  I can see that there is a ThumbnailUrl associated with each item when I debug in the browser but the ImageUrl is empty.  However, when I click on a Thumbnail image it makes a call to retrieve the full image with a unique imgid which is different than the imgid used for the smaller Thumbnail image. 

    Is there a different way to access the full image Url for each Thumbnail?  I've read all the documentation related to the RadImageGallery client-side objects but still can't figure out how to make this work correctly.

  2. Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 02 Oct 2014 Link to this post


    You are correct in your observations. When RadImageGallery is bound to a folder or a data source containing binary data the images are dynamically created and there is no way to know the big image URL before creating it. This is because the items are created on demand only when required in order to optimize performance.

    However, if you want to access the big image URL the approach you could implement is to create a static collection of RadImageGallery items and set its ImageUrl property on the first page load. This could be achieved by manually converting the bytes into files and then providing the URL's to the new files.

    Antonio Stoilkov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top