Custom Merge Field

2 posts, 0 answers
  1. Brendan
    Brendan avatar
    7 posts
    Member since:
    May 2009

    Posted 20 Feb 2012 Link to this post

    Hi,

    I'm trying to implement a custom mail merge field, inheriting from the CodeBasedField class.

    Let's say I want to create a HyperlinkField that will insert a Hyperlink with Display Text and an Address for my mail merge field.

    I've got it setup to the point where I can return a DocumentFragment based on a string when I override the GetResultFragment() function, but how can I go about constructing a DocumentFragment that would contain a hyperlink object instead of a string.

    Or If I wanted to return some other sort of RichTextBox element like a Table.

    I've looked up the Documentation for the DocumentFragment class and its members but it is very weak and doesn't describe much, or how to go about overriding the GetResultFragment() function in CodeBasedField.

    Can you direct me to some documentation or a sample that demonstrates this?

  2. Brendan
    Brendan avatar
    7 posts
    Member since:
    May 2009

    Posted 20 Feb 2012 Link to this post

    Well minutes after I posted, I found my answer.

    For future reference to anyone else viewing this thread, I found a sample in the WPF fourms

    http://www.telerik.com/community/forums/wpf/richtextbox/merge-reports.aspx

    Thanks.

Back to Top