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

Restrict tooltiptext displaying area

1 Answer 70 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Alvin
Top achievements
Rank 1
Alvin asked on 08 Dec 2011, 01:12 AM
Hi,

I have created ListVisualElement for storing a very long string, and also assign the string to the element's ToolTipText property.

When this visual element displayed in the RadListView and hover my cursor over it, the tooltip is displayed. Because the string is very long, the tooltip area will across the whole screen and some characters at the beginning of the string is cut.

Is there any way to specify the width of tooltip and the tooltip's displaying location?

Thanks

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 12 Dec 2011, 12:30 PM
Hello Alvin,

Thank you for your question.

There is no way to specify the width or height of the tooltip. However, you can modify its displaying location and also limit the length of its text on the ToolTipTextNeeded event as it is shown in the following code snippet:
void radListView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
{
    //Specifies the offset according to the current position of the mouse cursor
    e.Offset = new Size(e.Offset.Width + 20, e.Offset.Height + 20);
 
    //Specifies the text that will be displayed in the tooltip
    e.ToolTipText = e.ToolTipText.Substring(0, Math.Min(75,e.ToolTipText.Length));
}

I hope you find this helpful. If you have any additional questions, do not hesitate to write back.

Greetings,
Ivan Todorov
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Tags
ListView
Asked by
Alvin
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or