This is a migrated thread and some comments may be shown as answers.

Read only spans

1 Answer 57 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Tamas
Top achievements
Rank 1
Tamas asked on 27 Jan 2012, 01:20 PM
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

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 27 Jan 2012, 02:23 PM
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 >>

Tags
RichTextBox
Asked by
Tamas
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or