RadAjaxManagerProxy with RadToolTipManager and RadGrid

6 posts, 0 answers
  1. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 12 Feb 2013 Link to this post

    Hello

    We are using Telerik V2010 - Q1.  It seems that there is an issue with using RadToolTipManager with RadGrid and RadAjaxManagerProxy in that the tooltip shows up but almost immediately disappears.  Could someone please suggest a fix if there is any?  We need to use the RadAjaxManagerProxy.

    Thank you
    Raka
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5522 posts

    Posted 14 Feb 2013 Link to this post

    Hello Raka,

    Such behavior can be experienced if AJAX is not configured properly on your page. You must make sure the update panel that wraps the RadToolTIpManager and RadGrid has UpdateMode set to Conditional so that it does not dispose with the request the manager does in order to retrieve the content.

    This can be achieved in two ways:
    - make sure the initiator of the AJAX request (i.e. the AjaxControlID) is an IPostback control and not, for example, an ASP:Panel. You must also try to avoid nested update panels as much as possible because they are inherently problematic for MS AJAX. In this regard setting the RenderInPageRoot property of the manager can be helpful, so you should see if setting it to true helps.
    - replace the AJAX settings from the proxy with a regular ASP:UpdatePanel, e;g;
    <asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Conditional">
       <ContentTemplate>
           grid
           tooltip manager
       </ContentTemplate>
    </asp:UpdatePanel>


    Regards,
    Marin Bratanov
    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.
  3. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 19 Feb 2013 Link to this post

    Hi -- I still cannot get this to work.  But I have moved on with an alternative.

    Now I am having another strange problem with RadToolTip.  If the tooltip contains an html tag such as '<br />' or a new line such as '\n',
    it totally freaks out and doesn't show anything when one hovers over the item that should show the tooltip. 
    I have tried doing something like --
    Value.Replace("\n", "\r\n") and
    Value.Replace("\n", Environment.NewLine)

    nothing works. 

    How can it be that it doesn't accept html tag and doesn't recognize newline characters.
    Please help.

    Thanks
    Raka
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5522 posts

    Posted 20 Feb 2013 Link to this post

    Hello Raka,

    RadTooltips take HTML content, so in order to display a new line you need to have a <br /> tag in them. This can be either in their Text property, or as markup between the opening and closing tag, or inside a control that is added there. You should replace \n, \r and \r\n with a <br />.
    You can see that using HTML works with the following example:
    <telerik:RadToolTip ID="RadToolTip1" runat="server" Text="line 1<br /> line 2" TargetControlID="Button1"
        RelativeTo="Element" Position="BottomRight" Width="100px" Height="70px">
    </telerik:RadToolTip>
    <asp:Button ID="Button1" Text="hover for tooltip" runat="server" />

    You should make sure that there aren't JavaScript errors on the page and that the markup you use is valid. You can also try setting the RenderInPageRoot property to true in case the tooltips are inheriting some positioning from their parent elements.

    Kind regards,
    Marin Bratanov
    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.
  5. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 20 Feb 2013 Link to this post

    Hello Marin

    Thank you for your quick response.  I did try using "<br />" but when I do, it throws an error and if I disable the error in OnClient..Error JS, then the error goes away but the tooltip does not display. 

    I have a test string that looks like string str = "I am a test /n string".  Then I do a string replace with
    str.replace("/n", "<br/>");  When I replace it with str.replace("/n", "&lt;br/&gt;"); , it prints the line as --
    "I am a test <br/> string" rather than
    I am a test
    string


    I am using RadToolTipManager because I have the tooltips set up on a grid.  However I don't want to bind the tooltips in ItemDataBound Event handler.  Some of the tooltips are really large and we rather get them from DB as necessary.
    May be your solution works with using RadTooTip but it is not working with the Manager. 

    <telerik:RadToolTipManager runat="server" ID="rttm1" ManualClose="true" Width="280px" HideDelay="2" Skin="Telerik" Height="40px" RelativeTo="Element" Animation="Fade" Position="BottomCenter" style="font-size: 18px; text-align: center; font-family: Arial;" OnAjaxUpdate="rttm1_OnAjaxUpdate" RenderInPageRoot="true" />

    Thanks
    Sandhia

     

  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5522 posts

    Posted 21 Feb 2013 Link to this post

    Hi Sandhia,

    There isn't a reason for the <br /> tag to break the tooltips if there isn't an error thrown by something else. That aside, I tried this case again and it seems to work fine with AJAX loading as well. You can find attached my test page and a video from my experiment. I advise that you compare them with your case and try to find the reason for the problem - for example some malformed HTML could be breaking the tooltips or the AJAX response; special characters in the Value property must be escaped to allow for proper JSON serialization, etc.

    On a side note - the manual close button should be used by setting HideEvent to ManualClose and if you wish to change the styling of the text in the tooltips you should use CSS to override the default rules we have for the content area of the tooltips. You can inspect the element in the dev toolbar to see how to override it.


    Greetings,
    Marin Bratanov
    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.
Back to Top