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

RichTextBox MailMerge changes

2 Answers 28 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Clifford
Top achievements
Rank 1
Clifford asked on 08 Oct 2013, 12:07 AM
I am facing an interesting problem with the RadRichTextBox. I assemble a document converting documents to fragments, and the documents that contain the fragments can contain merge fields. There will only be a single merge. The assembled document is displayed in a RadRichTextBox that I want to display with the merged values, meaning that I display this RadRichTextBox with "Document.ChangeAllFieldsDisplayMode(FieldDisplayMode.Result)". A second RadRichTextBox displays the document used for assembly, depending on the fragment selected.

Seems like things are working well with the merge fields except that the values can change, and the changes are not reflected in the assembled document. When I change the ChangeAllFieldsDisplayMode back and forth the changed will be displayed. Any good way to fix this problem?

2 Answers, 1 is accepted

Sort by
0
Accepted
Petya
Telerik team
answered on 10 Oct 2013, 12:04 PM
Hello,

When a filed is inserted in Display mode and its value changes you have to make sure to update the field in order for the value to take effect. This can be done by right-clicking on the field and choosing the Update Field option. Additionally, you can update a field or all fields in the document using the methods of RadRichTextBox:
this.radRichTextBox.UpdateAllFields(FieldDisplayMode.Result); //all fields
this.radRichTextBox.UpdateField(rangeStart); //single field with FieldRangeStart range Start

I hope this helps!

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Clifford
Top achievements
Rank 1
answered on 30 Oct 2013, 09:32 PM
Thanks worked great
Tags
RichTextBox
Asked by
Clifford
Top achievements
Rank 1
Answers by
Petya
Telerik team
Clifford
Top achievements
Rank 1
Share this question
or