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

Custom Merge Field

1 Answer 136 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.
Brendan
Top achievements
Rank 1
Brendan asked on 20 Feb 2012, 03:07 PM

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?

1 Answer, 1 is accepted

Sort by
0
Brendan
Top achievements
Rank 1
answered on 20 Feb 2012, 03:15 PM

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.

Tags
RichTextBox
Asked by
Brendan
Top achievements
Rank 1
Answers by
Brendan
Top achievements
Rank 1
Share this question
or