I am trying to create a template editor for making letters for mailing.
I open up a new form with a RadRichTextEditor and an Editor Ribbon, and then assign a MailMergeDataSource.ItemsSource.
I add a few fields to the documents, and then use a DocxFormatProvider to get a byte[]
That array goes into an event with a Letter object inside. The event handler code is below.
All I want to do, is reload that byte[] into a different RadRichTextEditor, and then display the mailmerge fields like this <<MyCustomField>> and ideally highlight it. Instead, it's just displaying data from the ItemsSource. Below is the code that I think is relevant
private
void
LetterEditor_TemplateSaved(
object
sender, TemplateSavedEventArgs templateSavedEventArgs)
{
var provider =
new
DocxFormatProvider();
var doc = provider.Import(templateSavedEventArgs.Letter.LetterByteArray);
radRichTextEditor1.Document = doc;
radRichTextEditor1.Document.ShowMergeFieldsHighlight = true;
radRichTextEditor1.Document.FieldsDisplayMode = Telerik.WinForms.Documents.Model.FieldDisplayMode.DisplayName;
}