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

Custom MergeField

1 Answer 54 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Lenka
Top achievements
Rank 1
Lenka asked on 14 Nov 2013, 05:19 PM
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)

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 19 Nov 2013, 01:42 PM
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 >>
Tags
RichTextBox
Asked by
Lenka
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or