Skip to main content

ASPxRichEdit.CustomizeMergeFields Event

Fires when the ‘Insert Merge Field’ command button is clicked, and enables you to customize a drop-down field list.

Namespace: DevExpress.Web.ASPxRichEdit

Assembly: DevExpress.Web.ASPxRichEdit.v24.2.dll

Declaration

public event CustomizeMergeFieldsEventHandler CustomizeMergeFields

Event Data

The CustomizeMergeFields event's data class is CustomizeMergeFieldsEventArgs. The following properties provide information specific to this event:

Property Description
MergeFieldsNames Gets or sets a list of fields shown by the InsertMergeField command with their display names.

Remarks

Use the MergeFieldsNames property to specify fields and field names to show in the drop-down list.

View Example: Rich Text Editor for ASP.NET Web Forms - How to customize names of merge fields

<dx:ASPxRichEdit runat="server" WorkDirectory="~\App_Data\WorkDirectory" ID="RE"
    OnCustomizeMergeFields="RE_CustomizeMergeFields" DataSourceID="AccessDataSource1">
</dx:ASPxRichEdit>
protected void RE_CustomizeMergeFields(object sender, DevExpress.XtraRichEdit.CustomizeMergeFieldsEventArgs e) {
    foreach (var field in e.MergeFieldsNames) {
        if (field.Name == "ProductID") field.DisplayName = "ID of Product";
        else if (field.Name == "ProductName") field.DisplayName = "Name of Product";
    }
}
See Also