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

Rotator Buttons

3 Answers 83 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Jaime
Top achievements
Rank 1
Jaime asked on 14 Feb 2013, 03:47 PM
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

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 19 Feb 2013, 07:50 AM
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.
0
Jaime
Top achievements
Rank 1
answered on 19 Feb 2013, 01:07 PM
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
0
Slav
Telerik team
answered on 20 Feb 2013, 04:46 PM
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.
Tags
Rotator
Asked by
Jaime
Top achievements
Rank 1
Answers by
Slav
Telerik team
Jaime
Top achievements
Rank 1
Share this question
or