To reproduce:
- Add some comments and try to navigate through them.
- Try add or show/hide the comments while the cursor is in one of the comments.
Workaround:
Create a custom RichTextEditorRibbonBar
and override the following methods:
Public Class MyRichTextEditorRibbonBar
Inherits RichTextEditorRibbonBar
Protected Overrides Sub ButtonNewComment_Click(sender As Object, e As EventArgs)
Dim command As New InsertCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub ButtonDeleteComment_Click(sender As Object, e As EventArgs)
Dim command As New DeleteCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub ButtonPreviousComment_Click(sender As Object, e As EventArgs)
Dim command As New GoToPreviousCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub ButtonNextComment_Click(sender As Object, e As EventArgs)
Dim command As New GoToNextCommentCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub ToggleButtonShowHideComments_ToggleStateChanged(sender As Object, args As StateChangedEventArgs)
Dim command As New ToggleCommentsCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub ButtonDeleteAllComments_Click(sender As Object, e As EventArgs)
Dim command As New DeleteAllCommentsCommand(Me.AssociatedRichTextEditor.RichTextBoxElement)
Me.ExecuteCommand(command)
End Sub
Protected Overrides Sub HandleDocumentCommandExecuted(document As RadDocument)
MyBase.HandleDocumentCommandExecuted(document)
Dim hasComments As Boolean = Me.AssociatedRichTextEditor.Document.EnumerateChildrenOfType(Of CommentRangeStart)().Count() > 0
Me.buttonPreviousComment.Enabled = hasComments
Me.buttonNextComment.Enabled = hasComments
Me.buttonDeleteComment.Enabled = hasComments
Me.buttonDeleteAllComments.Enabled = hasComments
End Sub
End Class