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

Multiple levels of MergeField?

1 Answer 49 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Mari
Top achievements
Rank 1
Mari asked on 26 Mar 2013, 09:54 AM
Hi,

We are currently checking out Telerik controls to be used for our new project. Are the points below feasible?
1. Can we have a mergefield that is a Dictionary?

Ex. We have an Item class with a Dictionary property. Now, I want a mergefield that points to the keys of the the Dictionary property.

    Ex:
    <MERGEFIELD BeerBrands["Bud"]> or <MERGEFIELD BeerBrands.Bud>
   
    where Beerbrands = class property w/ch is a Dictionary
      Bud is the Key of the dictionary.  The result should be the value of the dictionary.

2. Taking this a step further, can we have a mergefield where the fieldName points to a Dictionary<string, new Dictionary<string, string>>.
    Ex. <MERGEFIELD BeerBrands.Bud.Price>

   where Beerbrands = class property w/ch is a Dictionary;
         Bud = key of the 1st Dictionary;
         Price = key of the 2nd dictionary

Regards,
Mari

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 28 Mar 2013, 11:16 AM
Hi Mari,
The syntax of the property path of merge fields is the same as the one used in the data bindings, described here. If this doesn't fit your scenario, you could relatively easy create custom merge fields which resolve PropertyPath property in custom way, for example as described in this forum thread.

You can also check the mail merge help article and demo application.

Kind regards,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Mari
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or