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

MergeField "DisplayName" or something similar?

1 Answer 70 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 03 Mar 2015, 02:12 PM
It is really easy to implement MergeField functionality. However sometimes I don't want the user to see the property-names of my MailMerge-Class but use different names, especially since properties don't allow spaces. Is it possible to use something like the "Display" annotation to have "speaking field names" instead of class properties? E. g. something like this:

public class MailMessageInfo
{
    [Display(Name="sender, first name")]
    public string SenderFirstName { get; set; }
 
    [Display(Name = "sender, last name")]
    public string SenderLastName { get; set; }
}

and RichTextBox takes the "Display" annotation to display the MergeField?

1 Answer, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 04 Mar 2015, 06:39 PM
Hello Neils,

MergeField does not support customizing the appearance of the Field Names, but you can implement a custom Merge Field to achieve your goal. For more details, please refer to the attached project, which demonstrates how this could be done.

Hope this helps.

Regards,
Tanya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
RichTextBox
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Tanya
Telerik team
Share this question
or