I am trying to include an ImageDraw (Neodynamic) item in a RadRotator template. To use this object, I need to be able to access it through the Item_DataBound event. However, I cannot get "FindInControl" to function. Is there any way to do this?
| Protected Sub RadRotator1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadRotatorEventArgs) Handles RadRotator1.ItemDataBound |
| Dim ImgElem As New ImageElement |
| Dim IDraw As Neodynamic.WebControls.ImageDraw.ImageDraw = RadRotator1.FindControl("ImageDraw1") |
| Dim labelPath As System.Web.UI.WebControls.Label = RadRotator1.FindControl("lblPath") |
| Dim labelUrl As System.Web.UI.WebControls.Label = RadRotator1.FindControl("lblUrl") |
| Dim Shadow As New Neodynamic.WebControls.ImageDraw.DropShadow |
| Shadow.Color = Drawing.Color.DimGray |
| Dim ResizeH As New Neodynamic.WebControls.ImageDraw.Resize |
| Dim ResizeW As New Neodynamic.WebControls.ImageDraw.Resize |
| ImgElem = ImageElement.FromFile(labelPath.Text.ToString) |
| ImgElem.Actions.Add(Shadow) |
| If ImgElem.Height > 400 Then |
| ResizeH.Height = 400 |
| ResizeH.LockAspectRatio = LockAspectRatio.HeightBased |
| ImgElem.Actions.Add(ResizeH) |
| End If |
| If ImgElem.Width > 600 Then |
| ResizeW.Width = 600 |
| ResizeW.LockAspectRatio = LockAspectRatio.WidthBased |
| ImgElem.Actions.Add(ResizeW) |
| End If |
| IDraw.Elements.Add(ImgElem) |
| End Sub |