Hide some mail merge fields

2 posts, 0 answers
  1. Michael
    Michael avatar
    41 posts
    Member since:
    Oct 2010

    Posted 02 Dec 2013 Link to this post

    Hi,


    I have an object which I use in Mail Merge.  Under "Insert Mail Merge" drop down ribbon button, all of these fields appear and I can use them just fine.  However, I don't need all properties to be displayed there.  Is there a way to specify which properties show and should not be included as part of the Mail Merge fields?



    Also, is it possible to give a different name to the Mail Merge item in the drop down ribbon button?  For example, if I have a property FirstName, I want it to display as "First Name".



    Thank you in advance.



  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 05 Dec 2013 Link to this post

    Hi,

    The simplest option would be to create another type which does not include the properties you don't wish to show. For this purpose you could use an anonymous type:
    this.radRichTextBox.Document.MailMergeDataSource.ItemsSource =
        from c in Clients
        select new
        {
            FirstName = c.FirstName,
            Address = c.Address
        };

    Your other option is to manually populate the dropdown in the ribbon. You can check Boby's post in this forum thread for a reference how this can be achieved. The approach also allows you to modify the string displayed in the drop-down.

    Let me know if you have any other comments or questions.

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top