RadRotator resizing issue

3 posts, 1 answers
  1. Effat
    Effat avatar
    16 posts
    Member since:
    Apr 2011

    Posted 12 Apr 2011 Link to this post

    I have a RadRotator with RotatorType = "CoverFlow". It's width is set to 100%. I used the following code to resize it but it gives me the error: "Microsoft JScript runtime error: Object doesn't support this property or method" on rotatorElement.RadResize();  

    var RadRotator1=<%= Rttr.ClientID %>;   
         var rotatorElement = document.getElementById("<%= Rttr.ClientID %>");     

    This is my ASPX code:

    <table cellspacing="0" cellpadding="0" width="100%" style="table-layout: fixed">
                <td align="left">
                    <telerik:RadRotator ID="Rttr" runat="server" Width="100%" ItemWidth="225" ScrollDirection="Left"
                        Height="285px" ItemHeight="165" ScrollDuration="500" FrameDuration="2000" RotatorType="FromCode"
                        InitialItemIndex="4" OnClientItemShown="OnClientItemShown" OnClientItemClicked="OnClientItemClicked"
                            <asp:Image ID="img1" runat="server" />
                    <telerik:RadCodeBlock ID="block1" runat="server">
                        <script type="text/javascript">
                            Telerik.Web.UI.RadRotatorAnimation.set_scrollAnimationOptions("<%= Rttr.ClientID %>",
                                                    reflectionHeight: 0.5, // The height of the reflection
                                                    reflectionOpacity: 0.25

    Can you please let me know what am I doing wrong and what can be done to fix the resizing issue??
  2. Answer
    Niko avatar
    383 posts

    Posted 13 Apr 2011 Link to this post

    Hi Effat,

    There is no official method in the client-side API to set the size of the RadRotator. Still you could change the size of the container element of the rotator. I see in your code that this is exactly what you are trying to accomplish. Still a regular DOM element doesn't have a RadResize method. What you need to do is change the style.width or style.height of the element. Please, make sure to set the values in pixels or any other metric system supported by CSS. Also there is a shortcut to document.getElementById - $get. Here is an example how to set things up:
         var rotatorElement = $get("<%= Rttr.ClientID %>");    
          rotatorElement.style.width = "225px";
          rotatorElement.style.height= "285px";  

    Hope this helps.

    All the best,
    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.

  3. DevCraft R3 2016 release webinar banner
  4. Effat
    Effat avatar
    16 posts
    Member since:
    Apr 2011

    Posted 19 Apr 2011 Link to this post

    Thanks alot :)
Back to Top