Example for creating radtooltip at runtime?

3 posts, 0 answers
  1. Joel
    Joel avatar
    172 posts
    Member since:
    Oct 2006

    Posted 14 Jan 2009 Link to this post

    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 
                    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. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 16 Jan 2009 Link to this post

    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,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Joel
    Joel avatar
    172 posts
    Member since:
    Oct 2006

    Posted 19 Jan 2009 Link to this post

    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....
Back to Top