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

RadRichTextBox and document template

2 Answers 129 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Tawfek
Top achievements
Rank 1
Tawfek asked on 24 Jun 2014, 03:33 PM
Hi
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.

Regards
tawfek

2 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 26 Jun 2014, 08:37 AM
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.

Regards,
Boby
Telerik
 
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.
 
0
Tawfek
Top achievements
Rank 1
answered on 30 Jun 2014, 01:21 AM
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.

Regards
Tawfek
Tags
RichTextBox
Asked by
Tawfek
Top achievements
Rank 1
Answers by
Boby
Telerik team
Tawfek
Top achievements
Rank 1
Share this question
or