5 Answers, 1 is accepted
Here is the currently supported events for the RadRichTextBox control....
The RadRichTextBox control raises the following specific events:
-
CommandError - occurs when an error gets thrown while executing a command. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- A CommandErrorEventArgs object.
-
CommandExecuted - occurs after a command gets executed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- A CommandExecutedEventArgs object. This arguments allows you to access the command to be executed and its command parameter.
-
CommandExecuting - occurs before a command gets executed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- A CommandExecutingEventArgs object. This arguments allows you to access the command to be executed and its command parameter and to cancel the command execution.
-
CurrentEditingStyleChanged - occurs when the current editing style changes. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object
-
CurrentParagraphStyleChanged - occurs when the position of the caret goes to another paragraph. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
CurrentSpanStyleChanged - occurs when the position of the caret goes to another word. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
CurrentVisiblePageChanged - occurs when the current page has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
DocumentArranged - occurs when the current document has been arranged. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
DocumentChanged - occurs when the current document has been changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
DocumentChanging - occurs before the current document gets changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
DocumentContentChanged - occurs when the content of the current document has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
DocumentLayoutModeChanged - occurs when the layout mode of the current document has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
HyperlinkClicked - occurs when the current page has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- A HyperlinkClickedEventArgs object. This argument allows you to access the URL and the target of the hyperlink.
-
IsReadOnlyChanged - occurs when IsReadOnly value has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
ScaleFactorChanged - occurs when the ScaleFactor value has changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- An EventArgs object.
-
SelectedLayoutBoxChanged - occurs when the current layout box gets changed. The event handler receives two arguments:
- The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
- A SelectedLayoutBoxChangedEventArgs object.
I don't see a way to get an event raised when hovering only over a comment.
You can enter a request for that feature in the Public Issue tracker and vote it up. The telerik engineers use this system to add new features to the controls. Check it out here : http://www.telerik.com/support/pits.aspx
Lancelot
As Lancelot said, there is no such event in our control, however you can do some custom logic for the mouse move:
this
.radRichTextBox.MouseMove +=
new
MouseEventHandler(radRichTextBox_MouseMove);
void
radRichTextBox_MouseMove(
object
sender, MouseEventArgs e)
{
Point p = e.GetPosition(
this
.radRichTextBox);
DocumentPosition position =
this
.radRichTextBox.ActiveEditorPresenter.GetDocumentPositionFromViewPoint(p);
Telerik.Windows.Documents.Model.Inline inline = position.GetCurrentInline();
if
(
this
.radRichTextBox.Document.GetContainingAnnotationRanges<CommentRangeStart>(inline,
false
).Count() > 0)
{
MessageBox.Show(position.GetCurrentWord());
}
}
In the example we show you how to attach to the mouse move event and check each time if the pointer is over a commented range. Then you can do some style manipulations to the words that are in comment. This solution may cause you some performance issues due to the frequency of this event . To improve this you can add timer for delayed execution to suppress most of mouse move events.
Don't hesitate to contact us if you have other questions.
Helpful
Regards,
Martin
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
In the RadRichTextBox, I have added HyperlinkInfo, when i move my mouse over a Hyperlink, it shows default HyperlinkToolTipFormatString ,
Is there any way to override this mouse event (Hyperlink_in_RadRichTextBox_MouseOver) ? So that i can add tooltip(webbrowser control) in it and show custom content including images for different hyperlinks in the Rad Rich text box.
What is the event raised when mouse is over to any hyperlink in rad rich text box by which we can see HyperlinkToolTipFormatString ? Is it possible to override this event ?
Thanks
Shantu
Hi Team,
Have the same issue which Asif Hossain has mentioned above is there a solution for it ? using latest telerik controls for silverlight.
The visual representation of the content in RadRichTextBox is based on the concept of UI layers stacked on top of each other. This also allows you to plug any custom visual elements based on the specific requirements of your application. Please go through the following online resources that will shed more light on the way a custom UI layer can be created and integrated with the control:
- Customize Presentation through UI Layers help article: Introduces UI layers and shows how to integrate one with RadRichTextBox.
- Search and highlight SDK example: Shows how to change the visual representation of specific content, in this case by drawing a Rectangle directly over the text.
- Custom layer and custom annotation SDK example: Demonstrates how to couple a specific type of annotation (in this case a custom one) with a UI layer. In your case, you'll need to work with the HyperlinkRangeStart/End classes.
I hope this information is helpful.
Regards,
Petya
Telerik