Read only spans

2 posts, 0 answers
  1. Tamas
    Tamas avatar
    1 posts
    Member since:
    Jan 2012

    Posted 27 Jan 2012 Link to this post

    Hi,
    I would like to insert one or more readonly spans into the document at runtime when the user clicks on a button. I've tried  few solutions but none of them worked.
    First i've tried the InsertInline method of the RichTextBox (and later the radDocument version) but i got an exception: InvalidCast with message unable to convert ReadOnlyRangeEnd to AnnotationMarkerStart. After this i have tried to insert only the spans and then use the function InsertReadOnlyRange but i got an exception again with message this inline is not the part of the document. So i've tried to call an UpdateEditorLayout, UpdateLayout and every update method before i used the InsertReadonlyRange but i got the same exception every time.
    The question is how can i insert a readonly text responding to a button click event?

    Reagrds
    Tamas
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 27 Jan 2012 Link to this post

    Hi Tamas,

    Inserting ReadOnly text is demonstrated in this forum post.
    The sample is for WPF, but the same code can be used in the Silverlight version of RadRichTextBox.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top