MergeField "DisplayName" or something similar?

2 posts, 1 answers
  1. Heiko
    Heiko avatar
    116 posts
    Member since:
    Oct 2012

    Posted 03 Mar 2015 Link to this post

    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?
  2. Answer
    Tanya avatar
    376 posts

    Posted 04 Mar 2015 Link to this post

    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.


    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.

  3. DevCraft R3 2016 release webinar banner
Back to Top