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

help stretching the rotator horizontaly

16 Answers 143 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 02 Nov 2008, 04:48 PM
I am starting to use the rotator control. But cant seem to make it stretch horizontaly when the user resizes the browser horizontaly.

I have the rotator width="100%" but when I grab the side of the browser to make it wider or narrower, normaly all my div's resize and stretch but now with the rotator it seem that the rotator does not resize at all with them.

is there a work around?

16 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Nov 2008, 01:58 PM
Hello Marc,


RadRotator does not support sizes in percents. The algorithm that calculates the position and moving of the items depends on exact values for the size of the control that are set in the initialization phase.

To be able to work with percents, browsers must suppot onresize event for HTML elements. Unfortunately so far only IE has such support - all other browsers have onresize event for the window object only. That is why at this point it is not possible to provide a reliable mechanism for sizing the control in percents. Of course if we find a suitable solution in the future, we will implement it right away.



Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Marc
Top achievements
Rank 1
answered on 18 Nov 2008, 04:15 PM
Thank you Geogi.

but, and dont forget that I am not an expert, I also tried puting the rotator inside a <div> with the overfolw:hidden and it even does not allow my div to riseze.
Is this normal? is there a way to do what I want to do?

<

 

asp:Panel SkinID="MainPhotoStrip" style="width:100%; overflow:hidden;" ID="Panel1" runat="server">

 

 

<telerik:radrotator ID="RadRotator1" runat="server"

 

 

DataSourceID="ObjectDataSource1" FrameDuration="0"

 

 

ItemWidth="30" Height="40" width="100%">

 

 

<ItemTemplate>

 

 

<table border="0" cellpadding="0" cellspacing="0" class="photo-frame">

 

 

<tr>

 

 

<td class="topx--"></td>

 

 

<td class="top-x-"></td>

 

 

<td class="top--x"></td>

 

 

</tr>

 

 

<tr>

 

 

<td class="midx--"></td>

 

 

<td>

 

 

<asp:Image ID="Image1" runat="server" SkinID="PhotoStripImage" ImageUrl='<%# "~/" + Eval("imageurl")%>' />

 

 

<td class="mid--x"></td>

 

 

</tr>

 

 

<tr>

 

 

<td class="botx--"></td>

 

 

<td class="bot-x-"></td>

 

 

<td class="bot--x"></td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

 

</telerik:RadRotator>

 

0
Lini
Telerik team
answered on 21 Nov 2008, 11:02 AM
Hi Marc,

As my colleague said, the problem is related to the rotator itself - we need to know its size in pixels in order to calculate the number of items to display. If the rotator is resized, we need to make those calculations again. At the moment, we cannot detect that, so the rotator will not resize when you change the window size. Whatever dimensions the rotator has when the page is loaded will remain until you reload the control or you call the set_height() or set_width() methods from the rotator client API.

Sincerely yours,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
RobDob
Top achievements
Rank 1
answered on 18 Feb 2009, 04:18 AM
Hello,

Is it NOT possible to have the rotator resize in relation to the size of the browser window.  I see that a simlar question was asked and addressed at the following link http://www.telerik.com/community/forums/aspnet/rotator/how-to-auto-resize-rad-rotator.aspx making me think that it was/is possible. 

Can you please let me know if getting the roatator to resize in relation to the browser window is posssible?

Thanks,
0
Fiko
Telerik team
answered on 20 Feb 2009, 11:59 AM
Hi RobDob,

The link that you posted is related to the old version of RadRotator. Currently RadRotator for ASP.NET AJAX can be resized in the desired manner only by using the approach that Lini described above.
Of course if we create such inbuilt functionality that produces a consistent result in all major browsers, we will add this information in the release notes.

Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
RobDob
Top achievements
Rank 1
answered on 20 Feb 2009, 07:45 PM
Hi,

Is it possible to get the old version of the rotator to woek in conjuction with the RadToolTip?  I really need to be able to get the control to resize with the window.. 

Thanks,
0
Fiko
Telerik team
answered on 23 Feb 2009, 12:41 PM
Hi Rob,

I suggest you to use the newest version of the RadControls. The RadRotator for ASP.NET control does not have methods for resizing the control and it is not developed anymore. In RadRotator for ASP.NET AJAX your scenario will be possible.


All the best,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
RobDob
Top achievements
Rank 1
answered on 23 Feb 2009, 12:58 PM
Hi,

>>"In RadRotator for ASP.NET AJAX your scenario will be possible."

Terrific please show me how with an example if possible, as I really need to be able to have the control resize with the window,  I don't need the amount of frames to increase just the space between them..

Thanks,
0
Fiko
Telerik team
answered on 24 Feb 2009, 12:16 PM
Hello RobDob,

By design the RadRotator for ASP.NET AJAX has methods which allows the user to set the size( set_width(), set_height()) of the control. I suggest you however to use this methods in the OnClientLoad() event handler only, when the element initially load. Note that the algorithm that calculates the position and moving of the items depends on exact values for the size of the control that are set in the initialization phase. If  RadRotator is resized after it was loaded, this will affect its functionality.

For your convenience I attached a simple project which demonstrates how can resize the RadRotator control in onresize event handler of the window object.

Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
RobDob
Top achievements
Rank 1
answered on 27 Feb 2009, 11:44 PM
Hello,

Thank you for your example however it doesn't really work,  using the old version of your RadRotator at least what I'm trying to do is possible although it doesn't work to smoothly it still works,  the attached example does not work and does not accomplish what I'm trying to accomplish.  Why is it that you drop important features like this moving forward?

Thanks,
0
Georgi Tunev
Telerik team
answered on 04 Mar 2009, 12:27 PM
Hi Rob,

Although they look similar, RadRotator for ASP.NET AJAX has very little in common with RadRotator for ASP.NET. The new control is basically rewritten from scratch and to be able to support its current features and others that would be implemented in the future, its size must be calculated in pixels.
So far we haven't received other request for resizing the control on the client and this is the main reason why such feature was not logged for implementation. Now I logged it in our database and we will consider it for a future release.

For the time being, I would suggest to try the attached solution that shows how to implement a similar functionality by using jQuery and RadRotator - I hope that it will be of help.


Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
RobDob
Top achievements
Rank 1
answered on 05 Mar 2009, 12:21 AM
Hello,

thakn you for your example, however your example does NOT work correctly within the latest version of IE.  would it be possible to obtain an example that does.

Thanks,
0
Georgi Tunev
Telerik team
answered on 06 Mar 2009, 12:01 PM
Hello RobDob,

If by latest IE you are referring to IE8 Beta, please note that we do not support browsers in Beta stage.
As for the project itself, the attached example use jQuery for controlling the size of the items and yes, it is not perfect, but it is the only one that we could suggest for now. As I previously said, this functionality is not supported in RadRotator out of the box and if you want you can implement a custom logic based on this one in the jQuery example.
I assure you that once we officially include this feature in our control, it will work as expected in all major browsers.


All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
RobDob
Top achievements
Rank 1
answered on 09 Mar 2009, 10:25 PM
Hi,

I'm using IE 7.0 and it doesn't seem to work..
Thanks
0
David C
Top achievements
Rank 1
answered on 14 Mar 2013, 07:12 AM
It would be really great if you could have an ad roator that auto resizes or at least explain how to do so with css.  Here is an example of an ad rotator that resizes.  This is very important because many users are viewing on cell phone.

For an example, click the below link and then resize the window.
http://urbanairship.com/
0
Slav
Telerik team
answered on 18 Mar 2013, 12:46 PM
Hello David,

RadRotator is designed to work only with fixed size. If its size or the size of its items is changed on the client, the calculations that are performed when sliding the items will not be correct, which will affect the proper functionality of the control.

If you need to change the width/height of the rotator dynamically, you will have to initiate an AJAX request to the server in order to apply the new size to the control. This Knowledge Base article includes an example of the described approach, which could be useful in you 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.
Tags
Rotator
Asked by
Marc
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Marc
Top achievements
Rank 1
Lini
Telerik team
RobDob
Top achievements
Rank 1
Fiko
Telerik team
David C
Top achievements
Rank 1
Slav
Telerik team
Share this question
or