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

Items in hidden panel

1 Answer 73 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Robert Verderber
Top achievements
Rank 2
Robert Verderber asked on 10 Oct 2011, 07:55 PM
I am using Rad Controls (version 2001.1.413.35). I have a RadAjaxPanel that has an ASP panel control in it. This panel gets hidden/displayed when a check box is selected/unselected. In the panel I have a ASP label control that has a tool tip associated with it. The process of hiding the panel and displaying it again in the RadAjaxPanel makes the tool tip not work any longer. This makes sense since it disappears from the DOM. 

Anyone know the proper way to re-associate/re-activate the tool tip with the label control after the RadAjaxPanel updates? 

Thanks in advance,

Robert

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 Oct 2011, 12:51 PM
Hi Robert,

The simplest way is to put the RadToolTip in the update panel as well so that it can reattach its events when it is recreated with the other elements after the resopnse is received.:
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
    <telerik:RadToolTip runat="server" ID="RadToolTip1" ShowEvent="OnClick" HideEvent="ManualClose"
        Width="300px" Height="100px" Text="lorem ipsum dolor sit amet" TargetControlID="Label1"
        IsClientID="false">
    </telerik:RadToolTip>
    <asp:Panel ID="Panel1" runat="server">
        <asp:Label ID="Label1" Text="click here for tooltip" runat="server" />
    </asp:Panel>
    <br />
    <asp:CheckBox ID="Checkbox1" Checked="true" Text="panel visible" AutoPostBack="true"
        OnCheckedChanged="changeVisibility" runat="server" />
</telerik:RadAjaxPanel>

protected void changeVisibility(object sender, EventArgs e)
{
    if (Checkbox1.Checked)
    {
        Panel1.Visible = true;
    }
    else
    {
        Panel1.Visible = false;
    }
}

A more difficult approach would be to use the RadAjaxManager so taht you can easily intercept the event when the response is received, then obtain the ClientID of the required label and use the RadToolTip's Client-side API to set the targetControlID.

Regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ToolTip
Asked by
Robert Verderber
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or