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

Readonly Paragraph

3 Answers 108 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 1
Adam asked on 01 Dec 2011, 12:28 PM
Hi,

I would like to create a main title with paragraph, (first paragraph is the title, second and more are freely editable text). I checked the new ReadOnlyRangeStart and End classes, but I can write before and after the read-only text. If I export the document model i got:
<t:Paragraph>
      <t:ReadOnlyRangeStart AnnotationID="1" />
      <t:Span Text="This is a Read-only text" />
      <t:ReadOnlyRangeEnd AnnotationID="1" />
</t:Paragraph>
Can I create somehow a read only Paragraph?

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 02 Dec 2011, 05:28 PM
Hi Adam,

ReadOnlyRanges are indeed a type of Inlines and you can restrict editing between a pair of ReadOnlyRangeStart and ReadOnlyRangeEnd, but the user will be able to add new inlines before the ReadOnlyRangeStart.
The good news is that in this case you can use the DocumentProtection regions we have introduced in Q3 2011 (2011.3.1116). The feature is not quite documented yet, but you can see it in action in this online demo and learn the basics from the document in the editor.

Best wishes,
Iva Toteva
the Telerik team

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

0
Adam
Top achievements
Rank 1
answered on 07 Dec 2011, 01:45 PM
Hi,

DocumentProtection regions are very good, but I have a little problem. Can I disable somehow the editable area highlight?
0
Iva Toteva
Telerik team
answered on 12 Dec 2011, 05:26 PM
Hi Adam,

RadRichTextBox uses layers for visualizing different parts of the document, such as the text, the highlighting color, the selection, etc. You can add new layers or remove existing ones by creating a custom UILayersBuilder and marking it with the [CustomUILayersBuilder] attribute like this:

[CustomUILayersBuilder]
public class CustomLayersBuilder:UILayersBuilder
{
    protected override void BuildUILayersOverride(IUILayerContainer uiLayerContainer)
    {
        uiLayerContainer.UILayers.Remove("PermissionRangesDecoration");
    }
}

The custom layer as defined above will use the default layers, but will remove the PermissionRanges decoration.

More information on customizing the presentation of the document using custom layers can be found here.
Best wishes,
Iva Toteva
the Telerik team

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

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