Remove readonlyrange() in richtextbox.

5 posts, 0 answers
  1. muhammad
    muhammad avatar
    28 posts
    Member since:
    Jul 2010

    Posted 18 Jul 2012 Link to this post

    Hi,
         I am trying to remove the readonlyrange in richtextbox. I have selection for that but the method provided in WPF requires a readonly field ReadonlyRangeStart. How can I get this field from selection. or is there any other way to deal with this problem thanks.


    In richtextbox I have selection of single word or paragraph. and need to extract readonlyrangestart field for method editor.document.deletereadonlyrange(readonlyrangestart);.

    Thanks.
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 19 Jul 2012 Link to this post

    Hello Muhammad,

    Please find attached a demo application which has implementation of deletion of read only ranges and making them editable. Please, look through it and let us know if you have any additional questions.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. muhammad
    muhammad avatar
    28 posts
    Member since:
    Jul 2010

    Posted 20 Jul 2012 Link to this post

    Hi Iva  ,
                I have tried in this way as well but it does not works. Actually I am trying to remove readonlyrange from document instead of documentEditor. and while doing so its throwing an exception. Moreover for a block its treating every thing a inlinebox like [2,011] are coming as five 5 boxes 1 for start block annotation 2nd for 2 third for , 4th for 011 and 5th for endblock annotation. where as its a single selection.
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 24 Jul 2012 Link to this post

    Hello Muhammad,

    The document is split into paragraphs and spans according to the formatting applied. However, each Span is presented by one or more SpanLayoutBoxes according to the content.
    In your example, if you have [2,011], where "[" and "]" are the ReadOnlyRangeStart and End, respectively, you will have the following document structure in terms of layout boxes: 
    1. "[" - AnnotationMarkerLayoutBox;
    2. "2" - SpanLayoutBox
    3. "," - SpanLayoutBox
    4. "011" - SpanLayoutBox 
    5. "]" - AnnotationMarkerLayoutBox.

    Please, provide some more details on your implementation and the exception you have encountered, as everything works correctly on our end, as you can see in the demo previously attached. In addition, we would appreciate it if you could attach your project in a support ticket and comment on why you wish to use the API of the document and not RadRichTextBox.


    Greetings,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. muhammad
    muhammad avatar
    28 posts
    Member since:
    Jul 2010

    Posted 24 Jul 2012 Link to this post

    Iva,
         Thanks for reply. The issue has been resolved. I was actually trying to convert readonly inlineboxes in different thread. Which is working now.

    Regards.
Back to Top
UI for WPF is Visual Studio 2017 Ready