Show/Remove Issue Tooltip in Updatepanel issue.

2 posts, 0 answers
  1. Veenu
    Veenu avatar
    45 posts
    Member since:
    Jun 2008

    Posted 25 Aug 2010 Link to this post

        We have TooltipManager on master page. The page inheriting master page has image which is binded to Tooltipmanager on master page. I want to show/hide tooltip on button click event which does postback after click. After clicking button, TargetControls of ToolTipManager are added/cleared. This doesn't work  when page is kept in UpdatePanel with UpdateMode=Conditional. The tooltip keeps on displaying on mouseover(should be removed when Hide button clicked).
    The client side code for master page is:
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" >               
            <asp:ContentPlaceHolder ID="cpHolder" runat="server">
            <table runat="server">
                <tr runat="server">
                        <td colspan="2" id="tdAddToolTip" runat="server">
                           <telerik:RadToolTipManager runat="server" ManualClose="true" Position="Center" ManualCloseButtonText="Close" 
                                     ID="rdToolTipManager"   Height="200" Width="350"
                                RelativeTo="Element"   OnAjaxUpdate="OnAjaxUpdate"  ContentScrolling="Default"
                            Skin="Telerik" />
    The server side for master page is:
               protected void Page_Load(object sender, EventArgs e)
                rdToolTipManager.TargetControls.Add("ctl00_cpHolder_img", true);
            protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
                Label tooltipLabel = new Label();
                tooltipLabel.Text = "Hey it works!!!";
    The page client side code is:
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" >
                <asp:ImageButton ImageUrl="~/Images/btn_graph.gif" ID="img" runat="server" />
                <asp:Button ID="btnHide" runat="server" OnClick="btnHide_Click" Text="Hide" />
                <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show" />
                <asp:AsyncPostBackTrigger ControlID="btnHide" EventName="Click"></asp:AsyncPostBackTrigger>  
                 <asp:AsyncPostBackTrigger ControlID="btnShow" EventName="Click"></asp:AsyncPostBackTrigger>      
    & the server side for the page is:
               protected void Page_Load(object sender, EventArgs e)
            protected void btnHide_Click(object sender, EventArgs e)
            protected void btnShow_Click(object sender, EventArgs e)
                ((Telerik.Web.UI.RadToolTipManager)(this.Page.Master.FindControl("rdToolTipManager"))).TargetControls.Add(img.ClientID, true); ;

    Please let me know if anyone knows or faced this issue earlier. Is there any other way to remove/show tooltip?

    Warm Regards
  2. Fiko
    Fiko avatar
    1406 posts

    Posted 30 Aug 2010 Link to this post

    Hi Veenu,

    I have already answered your support ticket. For convenience I have pasted a part of my answer here:
    "The behavior that you experience is the expected one, because the RadToolTipManager is not updated when its TargetControls collection is cleared. I recommend you to wrap the ToolTipManager control in an UpdatePanel with UpdateMode="Conditional". Then you can update the TooltipManager by calling the panel's Update() method:

    MaserPage file:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <telerik:RadToolTipManager runat="server" ManualClose="true" Position="Center" ManualCloseButtonText="Close"
                ID="rdToolTipManager" Height="200" Width="350" RelativeTo="Element" OnAjaxUpdate="OnAjaxUpdate"
                ContentScrolling="Default" Skin="Telerik" />

    Hide button click handler:
    protected void btnHide_Click(object sender, EventArgs e)

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top