Trouble with tooltip positioning

4 posts, 0 answers
  1. Christofer Hagstedt
    Christofer Hagstedt avatar
    9 posts
    Member since:
    Aug 2009

    Posted 08 Apr 2010 Link to this post

    Hi,

    I'm having trouble with the positioning of a radtooltip.

    I have a page containing a sort of quiz. It has a next and a previous button. To the buttons I add a page validation summary type of function. The summary is created serverside and opened.

    My tooltip code looks lite:

        <telerik:RadToolTip runat="server" ID="valSumPop" Animation="None" Skin="Simple" RelativeTo="Element" ShowEvent="FromCode" IsClientID="false" HideEvent="LeaveToolTip">
            <div style="padding: 5px;">
                <asp:Literal runat="server" ID="litValSum" />
            </div>
        </telerik:RadToolTip>

    and my serverside code looks something like this:

    string btID = ((LinkButton)sender).ID.ToString();
                valSumPop.TargetControlID = btID;
                valSumPop.Width = Unit.Pixel(125);

                string[] valStr = valSumText.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

                if (valStr.Length > 0)
                {
                    litValSum.Text = guiText.getGuiText("validationText", langId, companyId) + "<br />";

                    foreach (string s in valStr)
                    {
                        litValSum.Text += s + "<br />";
                    }

                    valSumPop.Show();
                }

    I attached 3 images to illustrate what happens. If I click the next button the tooltip appears below the button and far to the right. It also seems broken. The arrow is directly below the button but offset about 50-100 px.

    If the previous button is clicked once then the next button can be clicked and the tooltip is positioned properly.

    Does anyone know what causes this?

    Thanks

    /Christofer


  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 14 Apr 2010 Link to this post

    Hi Christofer,

    Your code seems to be correct and the only thing I can assume that might be causing the issue is that the DOCTYPE declaration you have is not the correct one. Please, make sure that your page is XHTML compliant and test again. We are continuously working on improving the behavior when the page is in quirks mode but there are still some challenges in this matter.

    If this does not help, please prepare a sample, fully runnable reproduction demo, open a new support ticket and send it to me along with detailed explanations and I will do my best to help.


    Kind regards,
    Svetlina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christofer Hagstedt
    Christofer Hagstedt avatar
    9 posts
    Member since:
    Aug 2009

    Posted 14 Apr 2010 Link to this post

    Hi,

    Our pages are Xhtml compliant but we do run them in quirks mode.  I tried changing to strict mode in our dev environment and it does seem to solve the problem but we are not able to change this in production at this time.

    I've run across a similiar behavior in a previous project where tooltips with an offset changed from topcenter to bottomcenter. We solved it that time by setting the initial direction to the opposit of what was intended and let the tooltips change by themselfs. Is there a default behaviour that explains why this may happen?

    /Christofer
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 19 Apr 2010 Link to this post

    Hello Christofer,

    Indeed, the dynamic repositioning of the tooltip and its callout causes the problem. What I can suggest is to test whether overriding the repositioning will help. To do so, please include the following script on your page:

    <script type="text/javascript">      
                 
         Telerik.Web.UI.RadToolTip.prototype._adjustCallout = function()      
      {      
            
      };      
          </script>


    Regards,
    Svetlina
    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