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

RadToolTipManager Error when double clicking event

12 Answers 125 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex Occhipinti
Top achievements
Rank 1
Alex Occhipinti asked on 21 Jun 2010, 08:25 PM
I have a RadScheduler and a RadToolTipManager that I use to show a custom hover over the events.  Following an example I used this code to add the tooltips to the events:

    protected void rsCalendar_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)
    {
        if ((e.Appointment.Visible) && (!IsAppointmentRegisteredForTooltip(e.Appointment)))
        {
            string strId;
            if (e.Appointment.RecurrenceState != Telerik.Web.UI.RecurrenceState.Occurrence)
                strId = e.Appointment.ID.ToString();
            else
                strId = e.Appointment.RecurrenceParentID.ToString();

            foreach (string strDomElementId in e.Appointment.DomElements)
                RadToolTipManager1.TargetControls.Add(strDomElementId, strId, true);
        }
    }
    private bool IsAppointmentRegisteredForTooltip(Telerik.Web.UI.Appointment Appt)
    {
        foreach (Telerik.Web.UI.ToolTipTargetControl ttControl in RadToolTipManager1.TargetControls)
            if (Appt.DomElements.Contains(ttControl.TargetControlID))
                return true;
        return false;
    }

Here is the .aspx side

    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"
        Width="300px" Height="80px" Text="Loading..." OnClientBeforeShow="clientBeforeShow"
        HideEvent="LeaveToolTip" Animation="None">
    </telerik:RadToolTipManager>

  The OnClientBeforeShow simply centers the tooltip.

  If I let the tooltip come up and then double click on an event it open the event and shows no error.  Likewise, if I double click quickly after I move the mouse onto the event I receive no error.  However, if I hesitate and do something in between the following error is shown:

RadToolTipManager response error:
 Exception=Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0

  The double click is processed and the event's details are shown, but now under the error pop-up.  This only appears to be happening in Firefox and Chrome.

Thanks!

12 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Jun 2010, 01:01 PM
Hello Alex,

Can you clarify whether you need to modify the current functionality from the online demo and how? The demo works fine under all supported browsers so I wonder if you can use it as it is.


Kind regards,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 17 Aug 2010, 12:48 AM

  Sorry for taking so long to reply.  The example shown is what I had been following.  It looks like it was updated slightly since I last used it, so I updated a sample project on my own following the same method.  Attached is the sample project that exhibits the pop-up error behavior indicated previously under Firefox.  This appears to have something to do with the Javascript of the RadTooltip, but I can't trace it down to anything specifically.  Any help is great appreciated.

Scheduler.aspx
<script type="text/javascript">
    function hideActiveToolTip() {
        var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
        if (tooltip) {
            tooltip.hide();
        }
    }
 
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
    function beginRequestHandler(sender, args) {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1) {
            hideActiveToolTip();
        }
    }
 
    function clientBeforeShow(sender, eventArgs) {
        w = $telerik.$(window).width() / 2;
        h = $telerik.$(window).height() / 2;
 
        if ((sender._mouseX > w) && (sender._mouseY > h)) {
            sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
            return;
        }
        if ((sender._mouseX < w) && (sender._mouseY > h)) {
            sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
            return;
        }
        if ((sender._mouseX > w) && (sender._mouseY < h)) {
            sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
            return;
        }
        sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
    }   
 
</script>
 
<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="300" Height="80"
        Animation="None" HideEvent="LeaveToolTip" Text="Loading..." RelativeTo="Element"
        OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" OnClientBeforeShow="clientBeforeShow"
        EnableShadow="true" />
    <telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="MonthView"
        OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnDataBound="RadScheduler1_DataBound">
    </telerik:RadScheduler>
</div>

Scheduler.aspx.cs
protected void RadScheduler1_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)
{
    if ((e.Appointment.Visible) && (!IsAppointmentRegisteredForTooltip(e.Appointment)))
    {
        string strId;
        if (e.Appointment.RecurrenceState != Telerik.Web.UI.RecurrenceState.Occurrence)
            strId = e.Appointment.ID.ToString();
        else
            strId = e.Appointment.RecurrenceParentID.ToString();
 
        foreach (string strDomElementId in e.Appointment.DomElements)
            RadToolTipManager1.TargetControls.Add(strDomElementId, strId, true);
    }
}
private bool IsAppointmentRegisteredForTooltip(Telerik.Web.UI.Appointment Appt)
{
    foreach (Telerik.Web.UI.ToolTipTargetControl ttControl in RadToolTipManager1.TargetControls)
        if (Appt.DomElements.Contains(ttControl.TargetControlID))
            return true;
    return false;
}
protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)
{
    int nApptId;
    if (!Int32.TryParse(e.Value, out nApptId))
        return;
 
    Telerik.Web.UI.Appointment Appt = RadScheduler1.Appointments.FindByID(nApptId);
 
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(new LiteralControl("ID=" + nApptId));
}
protected void RadScheduler1_DataBound(object sender, EventArgs e)
{
    RadToolTipManager1.TargetControls.Clear();
    ScriptManager.RegisterStartupScript(this, typeof(System.Web.UI.Page), "HideToolTip", "hideActiveToolTip();", true);
}
0
Peter
Telerik team
answered on 19 Aug 2010, 12:08 PM
Hello Alex,

It looks like you handle AjaxUpdate differently. Please, see the code we use in the demo:

protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
        {
            int aptId;
            Appointment apt;
            if (!int.TryParse(e.Value, out aptId))//The appoitnment is occurrence and FindByID expects a string
                apt = RadScheduler1.Appointments.FindByID(e.Value);
            else //The appointment is not occurrence and FindByID expects an int
                apt = RadScheduler1.Appointments.FindByID(aptId);
  
            AppointmentToolTip toolTip = (AppointmentToolTip)LoadControl("AppointmentToolTip.ascx");
            toolTip.TargetAppointment = apt;
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
        }


AppointmentToolTip.ascx is the user control that displays the tooltip content and you need to register it in your aspx page like this:

<%@ Reference Control="AppointmentToolTip.ascx" %>


Regards,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 20 Aug 2010, 02:34 AM
I implemented the indicated changes and receive the same results.  That is, the error message is still showing.
0
Peter
Telerik team
answered on 24 Aug 2010, 01:36 PM
Hello Alex,

Can you send us a simple working demo of the issue via a support ticket? We will test it locally and do our best to provide you with a solution.

Greetings,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 24 Aug 2010, 11:03 PM
Peter, I do have a working example that demonstrates the issue, but I do not believe that I can open a support ticket since I do not have an active subscription.  Could this be a bug in the version of controls that I am using?  I posted the exact code above that I am using in my demo.  I am using this with version 2009.3.1208.
0
Peter
Telerik team
answered on 25 Aug 2010, 04:25 PM
Hi Alex,

Yes, it is quite possible that this is a version specific problem. I have noticed that you have indicated that you use version 2010.1 519 in this thread's details. Can you try upgrading to at least this version and let us know how it goes?


Best wishes,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 25 Aug 2010, 04:38 PM
Is there someway to do that without having to fork out $800?  Or were you suggesting that the only fix for this would be to buy an upgrade to the latest version?
0
Peter
Telerik team
answered on 27 Aug 2010, 03:32 PM

I suggest you try with the trial version first to be sure that the problem will be solved. If yes, then let me know and I will negotiate a discount for your license renewal.

Greetings,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 30 Aug 2010, 07:28 PM
Peter, I just tried with version 2010.2.826.35 and received the same failure.
0
Peter
Telerik team
answered on 01 Sep 2010, 12:50 PM

Okay, then this means that the error is probably caused by something in the implementation and not a bug with the controls. I wonder if you can open  a support ticket and send us a simple working demo which we can test locally. I am asking for this because, we cannot experience the problem with our local tests.


All the best,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
answered on 07 Sep 2010, 11:12 PM
Thank you Peter, I have opened a support ticket.  346088
Tags
Scheduler
Asked by
Alex Occhipinti
Top achievements
Rank 1
Answers by
Peter
Telerik team
Alex Occhipinti
Top achievements
Rank 1
Share this question
or