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

Initial image functionality not working also Transparent Background not working also Animation type Fade not working

4 Answers 131 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
hkdave95
Top achievements
Rank 2
hkdave95 asked on 26 Aug 2008, 10:37 PM
            Dim loRadRotator As New DAREnterprises.Web.UI.clsRadRotator  
            loRadRotator.ID = "rrHome1" 
            loRadRotator.InitialItemIndex = 0 
            loRadRotator.ItemTemplate = New DAREnterprises.Web.clsRadRotatorTemplate  
            loRadRotator.RotatorType = Telerik.Web.UI.RotatorType.SlideShow  
            loRadRotator.SlideShowAnimation.Type = Telerik.Web.UI.Rotator.AnimationType.Fade  
            loRadRotator.FrameDuration = 5000 
            loRadRotator.BackColor = Drawing.Color.Transparent  
            loRadRotator.Height = New Unit(185)  
            loRadRotator.DataSource = loRotatorData1 
            Call loRadRotator.DataBind()  
            Call Me.divRadRotator1.Controls.Add(loRadRotator)  
 
Hi

I am creating my RadRotator programatically as above.

  • InitialItemIndex
  • RotatorType
  • Backcolor

All of the above don't seem to have an effect.

My Template is as below ...

Public Class clsRadRotatorTemplate  
        Implements ITemplate  
 
        Public Sub InstantiateIn(ByVal loContainer As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn  
            Call loContainer.Controls.Clear()  
 
            Dim loControl As New LiteralControl("<table style=""width: 100%; height: 100%""><tr><td>")  
            Call loContainer.Controls.Add(loControl)  
 
            Dim loImage As New Image  
            loImage.Height = New Unit(140)  
            AddHandler loImage.DataBinding, AddressOf img_DataBinding  
            Call loContainer.Controls.Add(loImage)  
 
            loControl = New LiteralControl("<br /></td></tr><tr><td>")  
            Call loContainer.Controls.Add(loControl)  
 
            Dim loText As New Label  
            AddHandler loText.DataBinding, AddressOf lblText_DataBinding  
            Call loContainer.Controls.Add(loText)  
 
            loControl = New LiteralControl("</td></tr></table>")  
            Call loContainer.Controls.Add(loControl)  
        End Sub  
 
        Sub img_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
            Dim loImage As Image = TryCast(sender, Image)  
            Dim loFrame As Telerik.Web.UI.RadRotatorItem = TryCast(loImage.NamingContainer, Telerik.Web.UI.RadRotatorItem)  
            loImage.ImageUrl = DirectCast(loFrame.DataItem, clsRotator).ImageURL  
            loImage.AlternateText = DirectCast(loFrame.DataItem, clsRotator).AlternateText  
        End Sub  
 
        Sub lblText_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
            Dim loLabel As Label = TryCast(sender, Label)  
            Dim loFrame As Telerik.Web.UI.RadRotatorItem = TryCast(loLabel.NamingContainer, Telerik.Web.UI.RadRotatorItem)  
            loLabel.Text = DirectCast(loFrame.DataItem, clsRotator).Text  
        End Sub  
 
        Public Sub New()  
            Call MyBase.New()  
        End Sub  
 
    End Class 

If you want to see the problem have a look at http://the-dl-outlet.co.uk

Kind Regards

David

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 27 Aug 2008, 02:13 PM
Hello hkdave95,

I tried to reproduce your case locally but to no avail - everything is working as expected. For convenience I attached to this thread a small sample that uses dynamically created RadRotator for ASP.NET AJAX that shows content from the Northwind database - I see in your code that you are using a custom implementation of the rotator.

As you can see in the attached project, the InitialItemIndex and RotatorType properties are working as expected, so I am not sure what can be the reason for the problem on your side. As for BackColor, this property is inherrited and currently RadRotator is not affected by it. To make the rotator transparent, you can use the following style:
.radr_clipRegion 
    background-color:transparent !important; 
.radr_item div 
    background-color:transparent !important; 


I hope this helps. If you still experience problems, please open a support ticket and send us a full, working sample project that reproduces them. Just make sure that the project can be run locally and is not missing files or database and attach it to the support ticket - we will check it right away.


Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
hkdave95
Top achievements
Rank 2
answered on 28 Aug 2008, 06:27 AM
Hi

Have you tried where there is only one data item for the Rotator ?

Kind Regards

David
0
hkdave95
Top achievements
Rank 2
answered on 28 Aug 2008, 06:29 AM
Hi

Also my Rotator is in a MultiPage.

Kind Regards

David
0
Georgi Tunev
Telerik team
answered on 29 Aug 2008, 11:31 AM
Hi David,

I attached a short video showing the rotator in multipage with only 1 item - as you can see, everything is working as expected. Please open a support ticket and send us a small sample project that isolates the problem so we can check it.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Rotator
Asked by
hkdave95
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
hkdave95
Top achievements
Rank 2
Share this question
or