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

Mail Merge UI Text Before & After if not empty

1 Answer 29 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 22 Jun 2012, 10:31 PM
Hi,

Is it possible to set the mail merge features via the UI to add text before and text after a field if it isn't empty?
I have seen that this is possible in code behind but I can't see to find a way to do it via the RadRichTextBox UI.

Thank you for your time,

Rob

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 27 Jun 2012, 07:53 AM
Hello Rob,

The InsertMergeFieldEmptyCommand does not include TextBeforeIfNotEmpty and TextAfterIfNotEmpty for the MergeFields when inserting them. In order to achieve this behavior, you should remove the binding to the InsertMergeFieldEmptyCommand and handle the Click event of the button.

You can refer to this post which shows how the dropdown can be constructed. What you should add is setters of the properties of the merge field TextBeforeIfNotEmpty and TextAfterIfNotEmpty when setting the fieldButton.CommandParameter.

Let us know if you need further assistance.

All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or