Document Template

2 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 30 Mar 2012 Link to this post

    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
  2. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    104 posts

    Posted 04 Apr 2012 Link to this post

    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 >>
  3. DevCraft banner
Back to Top