Readonly Paragraph

4 posts, 0 answers
  1. Adam
    Adam avatar
    3 posts
    Member since:
    Nov 2011

    Posted 01 Dec 2011 Link to this post

    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?
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 02 Dec 2011 Link to this post

    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 >>

  3. Adam
    Adam avatar
    3 posts
    Member since:
    Nov 2011

    Posted 07 Dec 2011 Link to this post

    Hi,

    DocumentProtection regions are very good, but I have a little problem. Can I disable somehow the editable area highlight?
  4. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

Back to Top