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

Document Template

1 Answer 83 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.
Andrew
Top achievements
Rank 1
Andrew asked on 30 Mar 2012, 12:05 PM
Is it possible to create some sort of template from which a RichTextBox content would be loaded?
With some addition of bound data? I want to use RichTextBox Document to print my data.

Basically i don't want to create the Document programmatically but rather i want to read the layout from some sort of file. Perhaps a XAML or XML file. In case i need to change the layout, i don't want to have to change the code.

Say i have 2 document sections one that has some static text and another that has gridview inside a table.

If i need to add another section say with some more static text, i want to simply go to some sort of template file and change it.

Is this possible? and how would i go about creating this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 04 Apr 2012, 12:48 PM
Hi Andrew,

As far as I understand your template case, you need something similar to our Structured Content Editing demo which you can find here with its code. There you have static content and recipe specific information.

You can use custom fields for placeholders in a document which you can create or extend  using the editor UI and  and a simple button to insert those fields extending AnnotationRangeStart and AnnotationRangeEnd at the required positions to mark the dynamic fields. You can read more about annotations in this article.

After creating the template document you can save it as XAML and then programmatically load it in your project and manipulate the fields with the document API.

If you are having difficulties achieving those tasks please get in touch with us and we will be happy to assist you further in this case.

All the best,
Martin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or