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

RadImageGallery throws out error: index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

3 Answers 154 Views
ImageGallery
This is a migrated thread and some comments may be shown as answers.
Deena
Top achievements
Rank 1
Deena asked on 27 Jun 2017, 02:18 PM

I have a repeater to list all products which contains pictures for each product

if I click product A which has 3 pictures, clicked the last pic, it shows properly

then I click product B which has 1 pictures, the page throws out error: index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

I believe the issue is on Proudct B, RadImageGallery still tries to show the third pic, and couldn't find it.

3 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 30 Jun 2017, 09:13 AM
Hello Deena,

Would you please modify the attached project so that it represents better your implementation and replicates the issue and send it back to us in an official support ticket or paste here the necessary modifications that should be applied? To run the project you should include the Telerik.Web.UI.dll assembly in the Bin folder.

Once we are able to replicate the issue, we would be able to provide you more specific suggestions. 

Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Deena
Top achievements
Rank 1
answered on 30 Jun 2017, 01:59 PM

hi Peter

thanks for reply, my project is so big.

let me make the question simpler:

when RadImageGallery loads, how I can make it show the first pic?

0
Peter Milchev
Telerik team
answered on 05 Jul 2017, 11:57 AM
Hello Deena,

I am afraid that I was unable to completely understand what you mean with "show the first pic". 

The first pic shows automatically, but you can choose a different starting picture by setting the CurrentItemIndex property. 

What I would suggest you is to modify the project attached in my previous reply so that it replicates the issue and send it back to us in an official support thread. Thus, we would be able to investigate your exact scenario locally and help you more efficiently. 

Once we have a closure in the support thread, we can share it here for convenience and better visibility from the community. 

Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ImageGallery
Asked by
Deena
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Deena
Top achievements
Rank 1
Share this question
or