| 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) |
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