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

ToolTipTextNeeded bug on Label

1 Answer 87 Views
Label
This is a migrated thread and some comments may be shown as answers.
Jerel
Top achievements
Rank 2
Jerel asked on 02 Sep 2009, 04:51 PM
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.

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 03 Sep 2009, 08:44 AM
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.
Tags
Label
Asked by
Jerel
Top achievements
Rank 2
Answers by
Deyan
Telerik team
Share this question
or