This is a migrated thread and some comments may be shown as answers.

Tooltip in Calendar shows the wrong date

6 Answers 135 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Jenny
Top achievements
Rank 1
Jenny asked on 09 Nov 2010, 12:23 PM
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!

6 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 09 Nov 2010, 12:28 PM
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
0
Jenny
Top achievements
Rank 1
answered on 09 Nov 2010, 01:01 PM
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>
0
Svetlina Anati
Telerik team
answered on 09 Nov 2010, 01:42 PM
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
0
Jenny
Top achievements
Rank 1
answered on 09 Nov 2010, 02:11 PM
Thanks again!
0
Jenny
Top achievements
Rank 1
answered on 03 Dec 2010, 10:38 AM
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?
0
Svetlina Anati
Telerik team
answered on 08 Dec 2010, 12:41 PM
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.
Tags
ToolTip
Asked by
Jenny
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Jenny
Top achievements
Rank 1
Share this question
or