Custom MergeField

2 posts, 0 answers
  1. Lenka
    Lenka avatar
    11 posts
    Member since:
    Mar 2007

    Posted 14 Nov 2013 Link to this post

    I need to create MergeField with "{Parent_FullName}" template (not like standart "{MergeField Parent_FullName}). 


    Is it possible to create CustomMergeField with Empty FieldTypeName? I tried to make it a standard way, but it crashed when i create CustomMergeField object 

    public class CustomMergeField : MergeField {
            private const string CustomFieldName = string.Empty;
     
            static CustomMergeField() {
                CodeBasedFieldFactory.RegisterFieldType(CustomMergeField.CustomFieldName, () => { return new CustomMergeField(); });
            }
     
     
            public override string FieldTypeName {
                get {
                    return CustomMergeField.CustomFieldName;
                }
            }

    PS I just try to find more easy way how to do this (like override few properties or method)
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 19 Nov 2013 Link to this post

    Hi,

    Thank you for the question!

    The result you wish to implement is not possible within the RadDocument structure as the internal logic depends on unique field name types. As you can see in the article concerning custom fields, the field name is used when registering the field. It is later used in the code fragment visible in the document (e.g. {MergeField Parent_FullName}), as well as in other internal logic.

    Please, excuse us for the inconvenience. Let us know if you have other questions.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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. DevCraft banner
Back to Top