RadRotator LoadOnDemand from XML File

2 posts, 0 answers
  1. Phill Hodgkinson
    Phill Hodgkinson avatar
    35 posts
    Member since:
    Nov 2004

    Posted 07 Mar 2011 Link to this post

    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.

  2. Niko
    Niko avatar
    404 posts

    Posted 09 Mar 2011 Link to this post

    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,
    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!
Back to Top