Tooltip in Calendar shows the wrong date

7 posts, 0 answers
  1. Jenny
    Jenny avatar
    6 posts
    Member since:
    Oct 2010

    Posted 09 Nov 2010 Link to this post

    I have changed the default tooltip of the controls to a Telerik tooltip by adding a RadTooltipManager and set the AutoTooltipify-property to true. At first there were double tooltips for the dates, but I got help with that in a previous thread (http://www.telerik.com/community/forums/aspnet-ajax/tooltip/calendar-with-radtooltipmanager-gets-two-tooltips.aspx)

    Now, I found that the tooltip is actually showing the wrong date! The corrrect tooltip is shown at first, but after changing e.g. the month the tooltip shows the wrong date. The date in the tooltip is from the month first displayed.

    Any help is greatly appreciated!
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 09 Nov 2010 Link to this post

    Hello Jenny,

     Do you by any chance use AJAX for the calendar? If so, make sure that you update the tooltip manager when you update the calendar and this should fix the problem.

    If this is not the case I am afraid I cannot assume what is going on and I will need to examine fully runnable reproduction demo. Please, provide such and I will do my best to help.

    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. Jenny
    Jenny avatar
    6 posts
    Member since:
    Oct 2010

    Posted 09 Nov 2010 Link to this post

    Hello Svetlina,
    Here's the page I'm using:

    <%@ Page Language="C#" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
            function OnCalendarViewChanged(sender, args) {
                $find("<%=RadToolTipManager1.ClientID %>").tooltipify(sender.get_element());
            
        </script>
        <form id="HtmlForm" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Skin="Hay" AutoTooltipify="true"
            AutoCloseDelay="0" RelativeTo="Mouse" OffsetY="10" OffsetX="10" ShowCallout="false"
            Position="BottomRight">
        </telerik:RadToolTipManager>
        <telerik:RadCalendar ID="Calendar1" runat="server" ClientEvents-OnCalendarViewChanged="OnCalendarViewChanged" />
        </form>
    </body>
    </html>
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 09 Nov 2010 Link to this post

    Hello Jenny,

     Thank you for the provided code, I was able to reproduce the problem.


    To achieve what you need you should dispose the old tooltips before tooltipifying. This is needed in this particular specific case because the cells in the new view of teh calendar are recognized as teh cells of the old view and there is already saved information about them.

    This being said, please modify your code as follows:

    <%@ Page Language="C#" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
      
        <script type="text/javascript"
            function OnCalendarViewChanged(sender, args) {
      
                var tooltipManager = $find("<%=RadToolTipManager1.ClientID %>");
                if (tooltipManager._tooltips) {
                    tooltipManager._disposeToolTips();
                    tooltipManager._tooltips = [];
                }
                tooltipManager.tooltipify(sender.get_element()); 
            }  
        </script>
      
        <form id="HtmlForm" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Skin="Hay" AutoTooltipify="true"
            AutoCloseDelay="0" RelativeTo="Mouse" OffsetY="10" OffsetX="10" ShowCallout="false"
            Position="BottomRight">
        </telerik:RadToolTipManager>
        <telerik:RadCalendar ID="Calendar1" runat="server" ClientEvents-OnCalendarViewChanged="OnCalendarViewChanged" />
        </form>
    </body>
    </html>

    I hope that my reply is helpful, let me know how it goes.

    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
  6. Jenny
    Jenny avatar
    6 posts
    Member since:
    Oct 2010

    Posted 09 Nov 2010 Link to this post

    Thanks again!
  7. Jenny
    Jenny avatar
    6 posts
    Member since:
    Oct 2010

    Posted 03 Dec 2010 Link to this post

    Hello again!
    I have discovered that when disposing the tooltips all tooltips on the page are removed. This is not what I want to happen. How do I dispose the tooltips of the calendar control only?
  8. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 08 Dec 2010 Link to this post

    Hi Jenny,

     In this case what I can suggest is the following:


    1) Use one RadToolTipManager for the calendar by tooltipifying it only as a zone as explained below:

    http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipzoneid/defaultcs.aspx

    2) Wrap the other content in another element, e.g DIV and set it as a zone to another tooltip manager.

    In this manner the first tooltip manager will have only the calendar tooltips and when you dispose them the other tooltips will not get disposed.

    Greetings,
    Svetlina
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017