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

Hide some mail merge fields

1 Answer 45 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 02 Dec 2013, 11:53 PM

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.



1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 05 Dec 2013, 02:51 PM
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 >>
Tags
RichTextBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or