RadToolTipManager and RadAjaxManager

2 posts, 0 answers
  1. Emil Hjordt Jensen
    Emil Hjordt Jensen avatar
    6 posts
    Member since:
    Jan 2007

    Posted 31 Jul 2007 Link to this post

    Hi Telerik,


    I'm trying to update the RadToolTipManager by using an RadAjaxManager. The tooltip works fine on the initial page-request but disappears on the ajax-postback.

    To illustrate, I've made the simplest possible example, that is like the scenario I need. May I emphasize that, yes, in this simple example you could make this work another way, but I would have to rebuilt some complicated stuff in the actual environment, to do it another way.

    Code-ahead:

    <asp:ScriptManager runat="server" /> 
                 
                <asp:Button ID="ReDataBindButton" Text="Re-databind plx" OnClick="ReDataBindButton_Click" runat="server" /> 
                 
                <asp:Panel ID="TesterPanel" runat="server"
                    <asp:Repeater ID="TesterRepeater" runat="server" OnItemDataBound="TesterRepeater_ItemDataBound"
                        <ItemTemplate> 
                            <asp:Label ID="TesterLabel" runat="server" /> 
                        </ItemTemplate> 
                    </asp:Repeater> 
                </asp:Panel> 
                 
                <radA:AjaxLoadingPanel ID="TesterLoadingPanel" runat="server" Height="75px" Width="75px"
                    <asp:Image runat="server" AlternateText="Loading..." ImageUrl="~/RadControls/Ajax/Skins/Default/Loading.gif" /> 
                </radA:AjaxLoadingPanel> 
                 
                <telerik:RadToolTipManager ID="TesterRadToolTipManager" runat="server" /> 
                 
                <radA:RadAjaxManager ID="TesterRadAjaxManager" runat="server"
                    <AjaxSettings> 
                        <radA:AjaxSetting AjaxControlID="ReDataBindButton"
                            <UpdatedControls> 
                                <radA:AjaxUpdatedControl ControlID="TesterPanel" LoadingPanelID="TesterLoadingPanel" /> 
                                <radA:AjaxUpdatedControl ControlID="TesterRadToolTipManager" /> 
                            </UpdatedControls> 
                        </radA:AjaxSetting> 
                    </AjaxSettings> 
                </radA:RadAjaxManager> 

    Code-behind ;):

    protected void Page_Load(object sender, EventArgs e) 
        { 
            this.DataBindStuff(); 
        } 
     
        private void DataBindStuff() 
        { 
            List<string> items = new List<string>(); 
            items.Add("item1"); 
            items.Add("item2"); 
            items.Add("item3"); 
            items.Add("item4"); 
            items.Add("item5"); 
     
            TesterRepeater.DataSource = items; 
            TesterRepeater.DataBind(); 
        } 
     
        protected void ReDataBindButton_Click(object sender, EventArgs e) 
        { 
            this.DataBindStuff(); 
        } 
     
        protected void TesterRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) 
        { 
            if (!(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)) 
                return
     
            Label TesterLabel = (Label)e.Item.FindControl("TesterLabel"); 
            TesterLabel.Text = (string)e.Item.DataItem; 
            TesterRadToolTipManager.TargetControls.Add(TesterLabel.ClientID, true); 
        } 

    Looking forward to your answer.

    Best regards,
    Emil Hjordt Jensen
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 31 Jul 2007 Link to this post

    Hi,

    Please use RadAjax Prometheus instead RadAjax and everything should  be ok.

    Your aspx must look like this:
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server" />    
                    
                <asp:Button ID="ReDataBindButton" Text="Re-databind plx" OnClick="ReDataBindButton_Click" runat="server" />    
                    
                <asp:Panel ID="TesterPanel" runat="server">    
                    <asp:Repeater ID="TesterRepeater" runat="server" OnItemDataBound="TesterRepeater_ItemDataBound">    
                        <ItemTemplate>    
                            <asp:Label ID="TesterLabel" runat="server" />    
                        </ItemTemplate>    
                    </asp:Repeater>    
                </asp:Panel>    
                    
                <telerik:RadAjaxLoadingPanel ID="TesterLoadingPanel" runat="server" Height="75px" Width="75px">    
                    <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/RadControls/Ajax/Skins/Default/Loading.gif" />    
                </telerik:RadAjaxLoadingPanel>    
                    
                <telerik:RadToolTipManager ID="TesterRadToolTipManager" runat="server" />    
                    
                <telerik:RadAjaxManager ID="TesterRadAjaxManager" runat="server">    
                    <AjaxSettings>    
                        <telerik:AjaxSetting AjaxControlID="ReDataBindButton">    
                            <UpdatedControls>    
                                <telerik:AjaxUpdatedControl ControlID="TesterPanel" LoadingPanelID="TesterLoadingPanel" />    
                                <telerik:AjaxUpdatedControl ControlID="TesterRadToolTipManager" />    
                            </UpdatedControls>    
                        </telerik:AjaxSetting>    
                    </AjaxSettings>    
                </telerik:RadAjaxManager>    
     
        </div> 
        </form> 
    </body> 
    </html> 
     

    If you face any other problems, please let us know.

    Greetings,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top