Rotator Buttons

4 posts, 0 answers
  1. Jaime
    Jaime avatar
    12 posts
    Member since:
    Feb 2013

    Posted 14 Feb 2013 Link to this post

    I am using custom buttons on the Rotator and would like to know how I can get the buttons to look like the default buttons when there are no items to scroll through. Basically I have my rotator wrapframes property set to false so when I reach the last item it should disable/fade the right side button. The same should happen if there are no items on the left side of the viewing frame.

    Does anyone have any suggestions?

    Thanks,

    Jaime
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 19 Feb 2013 Link to this post

    Hi Jaime,

    If you are using the inner property ControlButtons to specify custom elements that will function as RadRotator control buttons, you can dim the disabled button by declaring the CSS class rrButtonDisabled as shown in the following code snippet:
    <style type="text/css">
        .rrButtonDisabled {
            opacity:0.4;
            filter:alpha(opacity=40);
        }
    </style>

    In case you are using the client-side API of the rotator to slide its items, you can use the event OnClientItemShown to detect the index of the currently displayed item in order to disable the buttons when the first or the last item is shown.

    Kind regards,
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jaime
    Jaime avatar
    12 posts
    Member since:
    Feb 2013

    Posted 19 Feb 2013 Link to this post

    Thanks a bunch for your feedback. Is there an api call that can be made to get the total number of items in the rotator? I ask this because I need to know when the last item is shown so that I can disable the appropriate button/arrow. The sample you reference simple writes to the event log the current item index value which is great but I also need to know if that is the last item in the rotator.

    Thanks,

    Jaime
  5. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 20 Feb 2013 Link to this post

    Hi Jaime,

    You can retrieve the number of RadRotator items via the control's client-side API. To achieve this you should get the client-side object of the rotator through the $find method, then call the rotator method get_items(), which returns a collection of the items and use the length property to get their number. The following code snippet shows this approach:
    var rotatorItemsNumber = $find("<%=RadRotator1.ClientID %>").get_items().length;

    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.
Back to Top