6 Answers, 1 is accepted
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
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.
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.
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!
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.
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!