Approved
Last Updated: 19 Jun 2017 11:23 by Chuck
ADMIN
Hristo
Created on: 10 May 2017 10:54
Category: RichTextEditor
Type: Bug Report
1
FIX. RadRichTextEditor - exception when inserting a comment in a document with read only ranges and bookmarks
How to reproduce: create a document like the one below, then try to add a comment  for an element in the paragraph with the bookmarks
Public Class Form2
    Sub New()

        InitializeComponent()

        Dim document As New RadDocument()
        Dim section As New Section()
        Dim paragraph As New Paragraph()
        Dim span As New Span("Content prior range[")
        Dim span2 As New Span("]Content after range")
        Dim readOnlyContent As New Span("READ ONLY")
        Dim rangeStart As New ReadOnlyRangeStart()
        Dim rangeEnd As New ReadOnlyRangeEnd()
        rangeEnd.PairWithStart(rangeStart)
        paragraph.Inlines.Add(span)
        paragraph.Inlines.Add(rangeStart)
        paragraph.Inlines.Add(readOnlyContent)
        paragraph.Inlines.Add(rangeEnd)
        paragraph.Inlines.Add(span2)
        section.Blocks.Add(paragraph)
        document.Sections.Add(section)

        Dim bmSection As New Section()
        Dim bmParagraph As New Paragraph()
        Dim bmSpan As New Span("Content prior bookmark[")
        Dim bmSpan2 As New Span("]Content after bookmark")
        Dim bmContent As New Span("Content in Bookmark")
        Dim bmRangeEnd As New BookmarkRangeEnd()
        Dim bmRangeStart = DirectCast(bmRangeEnd.CreatePairedStart(), BookmarkRangeStart)
        bmRangeStart.Name = System.Guid.NewGuid().ToString()
        bmParagraph.Inlines.Add(bmSpan)
        bmParagraph.Inlines.Add(bmRangeStart)
        bmParagraph.Inlines.Add(bmContent)
        bmParagraph.Inlines.Add(bmRangeEnd)
        bmParagraph.Inlines.Add(bmSpan2)
        bmSection.Blocks.Add(bmParagraph)
        document.Sections.Add(bmSection)

        Me.RadRichTextEditor1.Document = document

    End Sub
End Class
Attached Files:
1 comment
Chuck
Posted on: 10 May 2017 18:17
User Comments cannot be added with either it appears. ie. if you are using Bookmarks and/or readonly ranges, trying to enter a new Comment will throw this exception... This is NOT documented anywhere, seems like when one feature is not supported when implementing another....should be documented, unless testing was not thorough...