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

dynamic Tooltip inside of RadAjaxPanel not showing

1 Answer 93 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 04 Feb 2009, 08:28 PM
Hi,
I tried to search but not able to find it. I am not able to make it work when putting tooltip control inside of radajaxpanel. Please suggest - thanks!

   
Structure is showing below
<AjaxPanel>
        <Button>
           <Panel>Dynamic Tooltip added from code behind
</AjaxPanel>


Sampe code

<telerik:RadAjaxPanel ID="test1" runat="server">
<
asp:Panel ID="pl" runat="server">   

 

 

<asp:Button ID="Button2" runat="server" Text="Show Login Form" CssClass="button" />       

 

 

/asp:Panel>   

</telerik:RadAjaxPanel>   

 


Code behind
Partial

 

Class test5

 

Inherits System.Web.UI.Page

 

 

 

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

        ShowPopupMessage(

 

            "adfadsf")

 

   End Sub

 

 

 


    Public
Sub ShowPopupMessage(ByVal message As String)

 

 

        Dim popupMessage As New Telerik.Web.UI.RadToolTip

        SetPopupControlProperties(popupMessage)

        popupMessage.Text = message

     

   Me.Form.Controls.Add(popupMessage)

 

 

 

    End Sub

 
        Private
Sub SetPopupControlProperties(ByRef control As Telerik.Web.UI.RadToolTip, Optional ByVal isModal As Boolean = False)

 

 

 

 

            With control

            .Position = Telerik.Web.UI.ToolTipPosition.Center

            .RelativeTo = Telerik.Web.UI.ToolTipRelativeDisplay.BrowserWindow

            .Animation = Telerik.Web.UI.ToolTipAnimation.FlyIn

            .ManualClose =

False

 

 

 

 

 

            .Modal = isModal

 

 

            .VisibleOnPageLoad =

 

True

 

 

 

 

            If isModal Then

                .ManualClose =

True

 

 

            Else

 

                .ManualClose =

 

False

 

 

 

 

 

 

 

 

 

            End If

 

 

          End With

 

 

 

 

 

 

 

 

End Sub

 

 

End

 

 

Class

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 10 Feb 2009, 08:47 AM
Hi Richard,
The problem is that you add the RadToolTip to the Controls collection of the FORM. However, you do not update the FORM, you update the RadAjaxPanel. That is why you have to add the RadToolTip to the RadAjaxPanel. For example:
Public Sub ShowPopupMessage(ByVal message As String
    Dim popupMessage As New Telerik.Web.UI.RadToolTip 
    SetPopupControlProperties(popupMessage) 
    popupMessage.Text = message 
    pl.Controls.Add(popupMessage) 
End Sub 

instead of:
Public Sub ShowPopupMessage(ByVal message As String
    Dim popupMessage As New Telerik.Web.UI.RadToolTip 
    SetPopupControlProperties(popupMessage) 
    popupMessage.Text = message 
    Me.Form.Controls.Add(popupMessage) 
End Sub 

Sincerely yours,
Tsvetie
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Richard
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or