RadRichTextBox and document template

3 posts, 1 answers
  1. Tawfek
    Tawfek avatar
    10 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 Link to this post

    I am using Telerik for WPF to develop my application. I am trying to develop an application that enable user to draft a document which follows a certain format ( I means well defined paragraphs, header, sub-headers etc). Initially I created data entry forms using MVVM approach but this proved to be unmanageable as there were literally many (>40 and growing ) formats. So my idea is instead of designing data entry forms, I would like to use MS Word approach that is to provide template for each type of document, and this templates come complete with shadow text that serve as hint/guide to user on what to write in the particular paragraph/section. For some section it will be pre-populated with data extracted from database. For example under geography section the system will automatically populate it with data/map snapshot from GIS system.
    Most of the sample documents that I have are in Word format, which I intent to save as template in strict open xml format. I have come across a Telerik demo that shows how to protect certain part of the document but I have not been able to see how this was specified in source document (xml input doc).
    What I am trying to do/know now is
    1- how to read template generated in MS-Word into RadRichTextBox
    2- is the open xml format is the right format that can act as template document in RadRichTextBox
    3- how to do shadow text that serves as hint
    4- how to protect selectively part of the document
    I really appreciate if someone can guide me, as I am very new in C# and Telerik, thanks.

  2. Answer
    Boby avatar
    636 posts

    Posted 26 Jun 2014 Link to this post

    Hi Tawfek,
    To your questions:
    1. and 2. RadRichTextBox supports various formats, which can be imported using the available format providers.
    3. Shadow text is not supported. You can come up with a custom solution using Span.Tag property or custom annotations, combined with custom UI Layer which visualizes them as tooltips or something similar, but this solution would work only if you create your templates in RadRichTextBox.
    4. You protect document using the document protection feature. An example for Silverlight is available here (the code should be the same for WPF, though). The feature also includes built-in highlighting of the text available for editing, so you can use it as replacement for 3. by inserting the hint text directly in the document.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. Tawfek
    Tawfek avatar
    10 posts
    Member since:
    Sep 2013

    Posted 29 Jun 2014 in reply to Boby Link to this post

    Hi Bobby
    My apology for not replying to your post sooner. I have implemented your suggestions and I am happy that it works now the way I want it.
    Thanks for your help.

Back to Top