RadToolTip with User Control

6 posts, 0 answers
  1. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 24 Aug 2013 Link to this post

    I have a simple User Control with which I'd like to add a RadToolTip.  Here's the layout code of the User Control:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="fcLine.ascx.cs" Inherits="Website.UserControls.FCLine" %>
     
    <asp:HiddenField ID="lineColor" runat="server" />  <%-- Used by client code dealing with MouseOver & MouseOut --%>
     
    <asp:Panel ID="panelLine" runat="server" CssClass="fcLine">
      <div>
        <asp:Panel ID="panelLeft" runat="server" CssClass="fcLineInnerLeft" />
        <asp:Panel ID="panelRight" runat="server" CssClass="fcLineInnerRight" />
     
        <%-- Note: Margin-Left's -10px = -1 * 1/2 * Width of the icon --%>
        <%-- Note: The Margin-Top value of 50% is replaced in the server-side code if a straight line is involved --%>
        <asp:Panel ID="panelBubble" runat="server" style="float:left; position:relative; margin-left:-10px; margin-top:50%">
          <img src="/Images/Shapes/circle2.png" style="position:absolute; left:0; top:0" />
          <p style="position:absolute; left:7px; color:white; font-weight:bold; padding-top:3px">
            <asp:Label ID="labelBubble" runat="server" />
          </p>
        </asp:Panel>
     
        <div style="clear:both"></div>
      </div>
     
    </asp:Panel>
     
    <telerik:RadToolTip ID="radToolTip1" runat="server" TargetControlID="panelLine" RelativeTo="Element" Position="BottomCenter" RenderInPageRoot="false">
      Hardcoded Test Tooltip
    </telerik:RadToolTip>

    This User Control is generally instantiated multiple times on a given page and is being used in an ASP.NET AJAX environment.

    Now, if I hardcode some text into the tooltip then everything works fine.  But what I really want to do set a custom string to radToolTip1.Text in the User Control's startup code [Page_Load or Page_PreRender or Page_Init].  When such code is implemented, it does run without any errors but then no tooltip appears.

    What am I doing wrong?

    Robert

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 26 Aug 2013 Link to this post

    Hi Robert,

    There shouldn't be an issue with using the Text property and my tests with it were successful. I am attaching here the small sample I used and that seems to work as expected with me. Could you compare it with yours to try and find the difference that is causing the problem? If you are setting an HTML string can you confirm it is well formed so that it does not break the RadToolTip and the page's markup?


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 26 Aug 2013 Link to this post

    Marin,

    I spent much of the day preparing a subset of my actual project for you, to demonstrate that the RadToolTip is not working.  When I finally had everything ready in this demo project ... the RadToolTip worked!  I went back to my actual project and tested it again (to ensure I wasn't imagining things) and sure enough, it did NOT work there.

    My theory was that there was some combination of UpdatePanels or something else related to AJAX that was interfering with the display of the RadToolTip.  But I do not know what it is.

    I do have the demo project which I could send you but I'm not sure what use it would be considering the RadToolTip is working fine in it.

    In your experience, has there ever been anything that has interfered with a RadToolTip appearing?

    For example, if one has a RadToolTip in a user control and has multiple instances of that user control displayed, could that possibly cause a problem?

    Frustrated.
  5. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 26 Aug 2013 Link to this post

    Marin,

    I finally was able to create a demo project that demonstrates what I've been talking about.  Because it contains a lot of my proprietary code, I've submitted a Support Ticket instead of discussing it publicly on here.

    Hopefully you or one of your colleagues can now see what I mean,

    Robert
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 27 Aug 2013 Link to this post

    Hi Robert,

    We will be looking into the sample in the ticket and continue the discussion there. Once we reach a conclusion you could post the final issue and its resolution here for others that may have similar difficulties.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  7. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 27 Aug 2013 Link to this post

    Marin,

    Let me echo what I said to you privately: Thank YOU!!!

    The culprit in my case was a malformed DIV tag in the Master Page!!!  Never in a million years would I have suspected this!

    In my situation, I am developing with VStudio 12 and IE9.  I don't use IE10 because it did not work properly with VStudio, at least not when it was first released.  But furthermore, my client's corporate standard is IE7 ... yes SEVEN.  It's a billion dollar company with tens of thousands of employees around the world so I have no power to require them to upgrade to a modern browser.

    Let me describe my page arrangement so you can appreciate how incredible it was that Marin found the problem.  In my ASP.NET 4.0 project, I was trying to add RadToolTips to User Controls here:

      Master Page
          Web Form
              Parent User Control
                  Child User Control 1 (CUC1)
                  Child User Control 2 (CUC2)

    I was trying to add RadToolTips to each of the two child user controls.  In the attached screenshot, CUC1 are the coloured rectangles you see.  CUC2 are the connecting lines.  Because the user has to enter a lot of information for each CUC1 they add, I thought it would be useful to display more data in a RadToolTip when they hovered over one of the user controls.

    But the RadToolTip failed to display anything!  Marin's [super diligent] investigation revealed two causes:
    1. That I was using IE7 (well, IE9 in IE7 mode).
    2. That there was a malformed DIV tag in the Master Page.

    Further to #2, I had originally had this simple tag in place:

    <div id="msg" />

    This had been there for years and so I had not looked at it in a long time.  But Marin pointed out to me that with the DIV tag, a formal closing tag needs to be present, like this:

    <div id="msg"></div>

    After making this change, the RadToolTip suddenly worked in the child user controls!!!

    I VERY MUCH appreciate the superb and rapid help provided by Telerik Support!  This makes my annual subscription well worth it!!!

    Thank you again, Marin.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017