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

[Solved] Styling and enabling the ToolTip

6 Answers 226 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Samson
Top achievements
Rank 1
Samson asked on 20 Jun 2011, 05:15 PM
Hi, I'm new to silverlight and telerik controls and I'm wondering if it is possible to style the ToolTip on the RadRich TextBox I'm looking for it to be red with white text. Also was wondering if it is possible to control when the tooltip appears, for example I only want it to be enable  when a certian condition is met  is this possible?

6 Answers, 1 is accepted

Sort by
0
Accepted
Vesko
Telerik team
answered on 22 Jun 2011, 12:38 PM
Hello Samson,

If I have understand your question right, you want to set a tool tip of the RadRichTextBox control itself, which to have custom style. You also want this tooltip to be enabled in certain cases.
About the custom styles - the answer is yes, you can have custom styles and templates. For more info see here.
To enable/disable tooltip - you can try setting/removing the tooltip using ToolTipService.SetToolTip(radRichTextBox, toolTip);/ToolTipService.SetToolTip(radRichTextBox, null); respectively.

Hope this helps!

Regards,
Vesko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Samson
Top achievements
Rank 1
answered on 23 Jun 2011, 02:53 PM
Thanks that was exactly what I was looking for the I found out how to style it via template but couldn't figure out how to disable and enable tried the IsEnable property with no luck the settooltip worked perfectly thanks again
0
Bob
Top achievements
Rank 1
answered on 08 Jul 2011, 10:25 PM
But is there a way to remove a tooltop of a Hyperlink in the HyperlinkClicked event? We want to clear out that Url and "Click to follow link" tooltip once clicked.

Example snippet:
private void rtBox_HyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
{
Hyperlink link = sender as Telerik.Windows.Documents.Model.Hyperlink;
ToolTipService.SetToolTip(link, null);
   ...yada yada more code

The example code above does not seem to fire when a link is clicked.
And setting the tooltip on the whole RichTextBox does nothing.
0
Iva Toteva
Telerik team
answered on 14 Jul 2011, 10:32 AM
Hi Bob,

The only customization you can apply to the tooltips of hyperlinks is by setting the HyperlinkToolTipFormatString of RadRichTextBox. The format you specify will be applied to all hyperlinks is the document.
Introducing different tooltips for links is on our to-do list, but has not been scheduled yet. You can use this PITS issue to track our progress: Pits Issue #6953.
On a side note, I could not find a case where the HyperlinkClicked event is not properly fired. However, the sender is not a Hyperlink. Hyperlinks have been obsoleted, due to the new functionality we have introduced (inserting bookmarks, embedding tables and images in the hyperlink, etc). The links in the document are marked by two inline document elements - HyperlinkRangeStart and HyperlinkRangeEnd. In between, you can have all kinds of elements, as long as they specify a valid document preserving the document structure. Thus, the sender is the Span or ImageInline you have clicked. As they are not UIElements, you cannot set the tooltip using the code in your snippet. 
Do you want to preserve the hyperlink in the document? Because it will be possible to remove the hyperlink, thus clearing the URL and tooltip. If that will suit your scenario, but you have trouble implementing it, we can assist you further.

Regards,
Iva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Bob
Top achievements
Rank 1
answered on 15 Jul 2011, 03:31 PM
No, our issue is if you mouse over the hyperlink you get the Url as a tooltip, and if you don't move your mouse when clicking, the content swaps out for new content, but the tooltip stays there for 5 seconds on top of the new content, again, not moving the mouse at all. Noting we're using the Silverlight TransitioningContentControl to add new content to. Even tried in the RadRichTextBox's Unload even to set the opacity/visivility/etc to hide the entire control on it's way out(which only takes a split second), but the tooltip remained.

I believe our version of the control(s) is 2010.3.1314.1040, by looking at the version of Telerik.Windows.Controls.RichTextBoxUI, and the other Telerik references. So maybe this "tooltip not clearing" bug has been fixed if there is a newer version of the conrol.

Sorry I can't share screenshots or code, it's an internal LOB app.
0
Vesko
Telerik team
answered on 21 Jul 2011, 10:17 AM
Hi Bob,

 Can you please send us a small sample application and steps to reproduce the problem? This will be very helpful for us.

Regards,
Vesko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
RichTextBox
Asked by
Samson
Top achievements
Rank 1
Answers by
Vesko
Telerik team
Samson
Top achievements
Rank 1
Bob
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or