Radscheduler with RadToolTipManager Problem

10 posts, 0 answers
  1. David
    David avatar
    20 posts
    Member since:
    Oct 2007

    Posted 07 Mar 2008 Link to this post

    I'm currently trying to integrate the RadToolTipManager with the RadScheduler so that the appointment pops up with the default information and custom resources from the RadScheduler.  I've gotten that to work, but now everything tries to open a radtooltip, not just the scheduler.  I put in the RadScheduler in the TargetControls Collection and that solved the problem of everything having a tooltip, but now I can't retrieve the appointment information.

    Here is the code I use to retrieve the appointment and it's info.  SelectedAppt successfully gets the index of the item from position 4 in the array, however when insert the scheduler as a target control the TargetControlID only has the name without any other info.

    Is there a different way to give the Radscheduler ToolTips without having everything trying to use the RadToolTipManager?

    protected

    void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
    {

    try

    {

    char[] splitters = { '_' };

    string[] SelectedAppt = (e.TargetControlID.Split(splitters));

    int aptIndex = Convert.ToInt32(SelectedAppt[4]);

    Appointment apt = RadScheduler1.Appointments[aptIndex];

    AppointmentToolTip tooltip = LoadControl("AppointmentToolTip.ascx") as AppointmentToolTip;

    tooltip.TargetAppointment = apt;

    RadToolTipManager1.Visible =

    true;

    e.UpdatePanel.ContentTemplateContainer.Controls.Add(tooltip);

    }

    catch (Exception ex)

    {

    }

    }


    Thanks,
    -David

  2. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 10 Mar 2008 Link to this post

    Hi,

    I implemented my scheduler without tooltip manager.
    * I have a panel within my Appointment template
    * I am handling AppointmentCreated event
    * creating a tooltip object dynamically
    * assigning the appointment client id as target for this tooltip
    * creating the content of tooltip as a Literal control and adding that to the tooltip
    * adding the tooltip control to the panel object itself.

    Telerik guys may have suggestion on this approach - but it works for me.

    -Piyush
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    20 posts
    Member since:
    Oct 2007

    Posted 11 Mar 2008 Link to this post

    Thank you very much for your response Piyush!

      I will try this in the meantime while I wait for the Telerik guys to provide feedback as well.

    Thanks,
    -David
  5. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 09 Jun 2008 Link to this post

    Thanks, Piyush. I will give your tip a try.

    For anyone at Telerik, I have been having the same problem, though strangely enough very inconsistently. I have been working with a Scheduler and TooltipManager, with a RadCalendar thrown in for extra measure (and for better navigation through the Scheduler), with everything updated via a RadAjaxManager.

    I haven't fully been able to establish what conditions lead to the Calendar and the Scheduler throwing up tooltips (as opposed to just the appointments)- it just happens fairly frequently. Not sure if this is because some weeks have no appointments, or if it is how/when the tooltipmanager's targetcontrols collection is cleared/refilled. In any case, this has been fairly unstable for me. To make matters worse, in some cases, if I have been navigating from week to week several times in a row on the week view (or via the calendar control), no tooltips at all are present.

    Any word from Telerik on possible solutions/updates would be greatly appreciated, as I have found that as more tooltips are added to a page, performance decreases rapidly, and in some cases the scheduler is going to be very full. I suspect that putting individual tooltips in a panel is going to be a good long-term solution for me.
  6. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 09 Jun 2008 Link to this post

    Hi there,

    You could attach ToolTip only for the Appointments that are currently shown in the Scheduler. Moreover, you could supply the ID of each Appointment, so that it is later used to get a reference to the Appoinment when creating the ToolTip and supply Appointment-related data.

    Please consider the following code:

    ASPX
            <telerik:RadScheduler  
                ID="RadScheduler1"  
                runat="server"  
                ... 
                OnAppointmentCreated="RadScheduler1_AppointmentCreated"
            </telerik:RadScheduler> 
             
            ... 
     
            <telerik:RadToolTipManager  
                ID="RadToolTipManager1" 
                runat="server"  
                OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"
            </telerik:RadToolTipManager> 

    C#
        protected void RadScheduler1_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e) 
        { 
            string clientID = e.Appointment.ClientID; 
     
            this.RadToolTipManager1.TargetControls.Add(clientID, e.Appointment.ID.ToString(), true); 
        } 
     
        protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e) 
        { 
            Appointment appointment = this.RadScheduler1.Appointments.FindByID(Int32.Parse(e.Value)); 
     
            TextBox textBox = new TextBox(); 
     
            textBox.Text = appointment.Start + " - " + appointment.End; 
     
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(textBox); 
        } 

    All the best,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 10 Jun 2008 Link to this post

    Thanks for the update, Simon. Acutally, I should have been more specific about my problem. I have no trouble with tooltips for appointments and filling those tooltips with data. The problem I have is that for some reason, my RadCalendar control occasionally (actually almost always) also opens a tooltip on the page when mousing over dates. This is happening despite the fact that I am adding tooltips to the tooltipmanager only on the appointmentcreated event, and clearing those tooltips whenever the view/timespan changes and/or the scheduler is re-bound. 

    Update: the RadMenu I am using on the page also opens tooltips.
  8. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 11 Jun 2008 Link to this post

    Hello Corey Alguire,

    Solely putting a RadToolTipManager on the page will tooltipify all elements which have already defined ToolTips.

    If you want to display ToolTips only for the controls added in the TargetControls collection of the RadToolTipManager, you should set its AutoTooltipify property to false.

    Please try this and let me know how it goes.

    Regards,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 11 Jun 2008 Link to this post

    Thanks, Simon!
    Well, I guess that is what happens when you just scan the documentation. I skipped right to the scenarios that most closely fit my situation and didn't pay much attention to anything else. I (now) remember reading the first bullet point in the ToolTipManager overview, but forgot about it completely until you pointed out the obvious to me. Thank you for pointing me in the right direction. Naturally, the ToolTipManager works fine for me now.

    Best Regards,
    Corey.
  10. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 18 Jun 2008 Link to this post

    Simon,
    One more follow-up. I have this working fine and behaving more or less properly in my development environment, but when I deploy to our testing server, a problem pops up. On the test server, the accounts we use to test do not initially have any appointments. This means initially zero appointments, and then on subsequent clicks in the RadCalendar which move the date in the scheduler and rebind it, also zero appointments. The problem is that when I navigate using the Rad Calendar, the RadCalendar suddenly has RadTooltips. No other control on the page has them, incudling other RadControls and other controls with normal tooltips. AutoTooltipify is set to false. Any ideas here?
  11. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 18 Jun 2008 Link to this post

    Never mind. I got this one figured out. I am using a RadAjaxManager, and the Calendar was not updating the TooltipManager. Now it is, and everything is fine again.

    Best Regards,
    Corey
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017