ToolTipTextNeeded bug on Label

2 posts, 0 answers
  1. Jerel
    Jerel avatar
    7 posts
    Member since:
    Feb 2009

    Posted 02 Sep 2009 Link to this post

    I have discovered what I believe to be a bug on the RadLabel control. When you react to the ToolTipTextNeeded event the sender is the Label element and not the label control, this is contrary to the other events, such as the mouse click event which the sender is the Label.
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 03 Sep 2009 Link to this post

    Hello Jerel,

    Thanks for contacting us. Actually this is not a bug. ToolTipTextNeeded event is implemented on a RadElement level (RadElement is the base class for all elements which are used to build the visual hierarchy of a RadControl) and thus the sender object contains the element which initiated this event. If you want to have a reference to the control which is associated with the element the following code snippet demonstrates how to achieve this:

    private void OnToolTipText_Needed(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)  
            {  
                RadLabelElement labelElement = sender as RadLabelElement;  
     
                if (labelElement != null)  
                {  
                    RadLabel labelControl = labelElement.ElementTree.Control as RadLabel;  
     
                    if (labelControl != null)  
                    {  
                        //....  
                    }  
     
                }  
            } 

    I hope this helps. Do not hesitate to write back to us if you need furher assistance.

    Regards,
    Deyan
    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
Back to Top