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

Getting to tooltips from radcontrol

2 Answers 79 Views
Form
This is a migrated thread and some comments may be shown as answers.
Ruth Goldberg
Top achievements
Rank 1
Ruth Goldberg asked on 14 Jan 2010, 09:42 PM
I'm trying to loop through all controls and translate text and tooltips. The text is under the control and the tag (which I'm using) can be found under the ElementTree.RootElement. I see that the toottip is under RadItem. How do I get to the RadItem from a RadControl or RadElement?

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 20 Jan 2010, 11:39 AM
Hi Ruth Goldberg,

Thank you for writing. Actually, there is no way to change the ToolTip for every control without taking into account the RadControl type. You can iterate over all controls and set the ToolTipText, but you will notice that this will not work for every RadControl:

foreach (Control control in this.Controls)
{
    if (control is RadControl)
    {
        RadItem item = ((RadControl)control).RootElement.Children[0] as RadItem;
        item.ToolTipText = "myText";                  
    }
}

You have to do this considering the specific controls that you have used in your form. Write me back if you have any additional 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.
0
Ruth Goldberg
Top achievements
Rank 1
answered on 21 Jan 2010, 01:34 PM
Thank you for your reply. I had actually figured out by the time I got your reply that the controls with tooltips were items under their parent control. However, I was testing each type of control separately and casting to the appropriate control type. With your method, I can trap other types that I might have missed by just checking if the child is a RadItem type.
Tags
Form
Asked by
Ruth Goldberg
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Ruth Goldberg
Top achievements
Rank 1
Share this question
or