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

RadRotator LoadOnDemand from XML File

1 Answer 73 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Phill Hodgkinson
Top achievements
Rank 1
Phill Hodgkinson asked on 08 Mar 2011, 02:46 AM
Hi There,

Is is possible to use the RadRotator in LoadOnDemand mode when the data comes from an XML file? I have an xml file with approx 200 images listed. I want users to be able to scroll one image at a time but naturally I don't want to have to load 200 images when the rotator loads, I want to be able to load images one at a time.

Any pointers to pull this off, preferably without having to write a web service, would be greatly appreciated.

Regards,
Phill

1 Answer, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 09 Mar 2011, 03:48 PM
Hi Phill,

Usually the easiest way would be to use a web service for loading dynamically the rotator items, as this functionality is already built-in. For a reference here is the URL to the demo for LoadOnDemand - http://demos.telerik.com/aspnet-ajax/rotator/examples/loadondemand/defaultcs.aspx.
If you decide to do a custom implementation you will need to recreate the build-in functionality. Here is a draft of the basic things that you will need to implement for this scenario:
  1. Create a handler that gets the needed image from the XML data file.
  2. The rotator needs to be set of type FromCode
  3. The advancing of the rotator should be a custom implementation and should be synchronized with the data loaded from the server.
  4. In the hander of the Ajax request the following client side API functions should be used: addRotatorItem and after that repaint of the rotator.
Basically implementing a custom solution appears to be more complex that creating a simple web service.

Hope this helps.

All the best,
Nikodim
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Rotator
Asked by
Phill Hodgkinson
Top achievements
Rank 1
Answers by
Niko
Telerik team
Share this question
or