Customize tooltip content?

6 posts, 0 answers
  1. mrdcpwns
    mrdcpwns avatar
    16 posts
    Member since:
    Dec 2009

    Posted 27 Dec 2009 Link to this post

    Is it possible to change the tooltip content when the mouse is over an appointment and make it similar to the one shown on the First Look demo under Scheduler for WPF (containing image,other details,etc.) ?
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 30 Dec 2009 Link to this post

    Hello mrdcpwns,

    Thank you for the question. ToolTip does not support the described functionality. However, you can use a ScreenTip in this case. It offers extended formatting capabilities compared to ToolTip. Please, consider the following code:

    void radScheduler1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
    {
        AppointmentElement appointmentElement = e.Item as AppointmentElement;
        if (appointmentElement != null)
        {
            RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
            screenTip.MainTextLabel.Text = "This is a ScreenTip";
            appointmentElement.ScreenTip = screenTip;                
        }
    }

    Do not hesitate to contact me again if you have any other questions.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. mrdcpwns
    mrdcpwns avatar
    16 posts
    Member since:
    Dec 2009

    Posted 01 Jan 2010 Link to this post

    Although I'm not able to test out the code you've provided since I'm more familiar with vb.net, the information you've provided regarding the screentip was really helpful. Thanks.
  5. Nick
    Admin
    Nick avatar
    767 posts

    Posted 05 Jan 2010 Link to this post

    Hello mrdcpwns,

    Thank you for your positive feedback. As to C# to VB translation and the reverse you can use this code converter provided by Telerik.

    Regards,
    Nick
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 12 Apr 2013 Link to this post

    Hmm 

    Is there a simple way to just change the original text to include more text as this RadOffice2007ScreenTipElement 
    looks nothing like the original screen tip

  7. Paul
    Admin
    Paul avatar
    60 posts

    Posted 17 Apr 2013 Link to this post

    Hello Denis,

    Thank you for writing.

    In order to manage the tooltip text you should use the ToolTipTextNeeded event. Here is a sample demonstrating how to extend the existing tooltip with some custom text:
    Private Sub RadScheduler1_ToolTipTextNeeded(sender As Object, e As Telerik.WinControls.ToolTipTextNeededEventArgs) Handles RadScheduler1.ToolTipTextNeeded
           Dim appElement As AppointmentElement = TryCast(sender, AppointmentElement)
           If appElement IsNot Nothing Then
               e.ToolTipText = e.ToolTipText & "  " & appElement.Start.TimeOfDay.ToString() & " " & appElement.End.TimeOfDay.ToString()
           End If
       End Sub

    I hope this helps. Please do not hesitate to contact us in case you need any further assistance.

    All the best,
    Nikolay Aleksiev
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top
UI for WinForms is Visual Studio 2017 Ready