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

Example for creating radtooltip at runtime?

2 Answers 92 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 14 Jan 2009, 09:32 PM
Is there an example for creating and binding a radtooltip to another runtime created control?  I have used it before with success when statically defined, but I tried something simple today I thought should work and it does not.  Everything is in as expected in viewsource, but no popup.  This is called in page.preinit.  There are radnumerictextboxes in the previous cell of the same row, created within the same loop, that work perfectly fine.
 
    If Not IsDBNull(myreader("rollovertext")) Then 
                    Dim tooltip As New Telerik.Web.UI.RadToolTip 
                    Dim qimage As New System.Web.UI.WebControls.Image 
                    Dim imgname As String 
                    imgname = "img" & CStr(myreader("CalcOrderID")) 
                    With qimage 
                        .ImageUrl = CStr(myreader("ImgPath")) 
                        .ID = imgname 
                    End With 
                    With tooltip 
                        .ID = "tooltip" & CStr(myreader("CalcOrderID")) 
                        .TargetControlID = qimage.id 
                        .Text = CStr(myreader("rollovertext")) 
                        .Width = "150" 
                        .AutoCloseDelay = 10000 
                        .Skin = "Web20" 
                        .Position = ToolTipPosition.MiddleRight 
                        .OffsetY = 0 
                        .OffsetX = 10 
                        .ShowDelay = 300 
                    End With 
 
                    helpcell.Controls.Add(qimage) 
                    helpcell.Controls.Add(tooltip) 
                End If 



Viewsource shows this:

<img id="img2" src="images/qmark16.png" style="border-width:0px;" /><div id="tooltip2" style="display:none;"
                    <input id="tooltip2_ClientState" name="tooltip2_ClientState" type="hidden" /> 
 
 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadToolTip, {"autoCloseDelay":10000,"clientStateFieldID":"tooltip2_ClientState","formID":"form1","offsetX":10,"offsetY":0,"position":23,"showDelay":300,"skin":"Web20","targetControlID":"img2","text":"roll 3","width":"150px"}, null, null, $get("tooltip2")); 
}); 
 
 

Thank you for any insight you can provide.

2 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 16 Jan 2009, 04:05 PM
Hi Joel,

Your code seems to be correct, I built a test demo based on it and it worked as expected. The snippet of the source you provided also seems correct and the tooltip is correctly initialized. That is why I cannot tell you what causes the issue until I debug the problem.

Would you please examine the attached demo and test it on your side? In case it works fine, modify it in order to replicate the issue, open a new support ticket and send it to me along with your explanations and I will do my best to help you resolve the problem.

Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Joel
Top achievements
Rank 2
answered on 19 Jan 2009, 06:41 PM
I eventually found it.  Thank you for your help. 

In the interest of self-flagellation, If anyone else runs into this, make sure your form tag is inside your body tag, not the other way around....
Tags
ToolTip
Asked by
Joel
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Joel
Top achievements
Rank 2
Share this question
or