Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rotator > Load fresh data after one full rotation

Answered Load fresh data after one full rotation

Feed from this thread
  • Posted on Aug 17, 2011 (permalink)

    I am trying to load fresh data after one full rotation of the rotator. After a full cycle completes I'd like to have an event fire to reload new data and there's no event so far as I can see to do this. The data consists of live scores for a sporting event and I'd like to use one full rotation as the trigger to refresh the data. I am using the Live XML example as my basis. Please advise on the best way to accomplish this as there's no event to signal that a rotation is complete. Clearly the rotator must know when a cycle is complete since it can wrap frames. Thank you.

    Regards,
    George 

    Reply

  • Answer Slav Slav admin's avatar

    Posted on Aug 23, 2011 (permalink)

    Hello George,

    You can detect a full rotation by checking the index of the current item. This is achieved via the Client API of the RadRotator. Please use the following steps to implement this functionality:

    1. The RadRotator has a client-side event OnClientItemShown, which is fired every time a new item is shown. It will be handled in order to perform a check on every item.

    2. The index of the currently shown item is referenced via the radRotator.get_item().get_index() structure, where radRotator is the client object of the rotator. Depending on the current index, a check is performed whether the last item of the RadRotator is displayed. If this is the case, an AJAX request is sent to the server via the RadAjaxManager.

    3. From the code-behind the data of the rotator is rebinded on the AjaxRequest event of the RadAjaxManager.

    Please find attached a sample project, implementing the desired functionality. You may use it as a base for your further development.

    Greetings,
    Slav
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Reply

  • Posted on Aug 23, 2011 (permalink)

    Thanks for this. I'll be looking at it to see if it solves my problem. If so, I'll let you know and mark it as solved.

    Thanks again.

    Regards,
    George

    Reply

  • Posted on Aug 24, 2011 (permalink)

    This solution works well for what I am trying to accomplish. Thank you.

    Regards,
    George

    Reply

  • Steve avatar

    Posted on Nov 17, 2011 (permalink)

    This solution works, except for one thing - if there's only one item in the dataset, the ItemsShown function can't find the RadAjaxManager.  Any thoughts?

    Reply

  • Slav Slav admin's avatar

    Posted on Nov 21, 2011 (permalink)

    Hello Steve,

    The RadRotator control is designed to contain more elements than it can show in its ViewPort. This is why when there is only one item in the rotator control the animation doesn't start. You can handle such scenarios by adding empty items to the RadRotator in order to supply the number of items needed for the rotation to start.

    I have attached a sample project that demonstrates the solution above. Please use it as a reference for handling the specific case.

    All the best,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rotator > Load fresh data after one full rotation
Related resources for "Load fresh data after one full rotation"

[  ASP.NET Rotator Features  |  Documentation  |  Demos |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]