Back to Devexpress

DxMailMergeSettings Class

blazor-devexpress-dot-blazor-dot-richedit-c2b7f073.md

latest3.6 KB
Original Source

DxMailMergeSettings Class

Contains the mail merge settings.

Namespace : DevExpress.Blazor.RichEdit

Assembly : DevExpress.Blazor.RichEdit.v25.2.dll

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public class DxMailMergeSettings :
    ParameterTrackerSettingsComponent,
    IMailMergeSettings

Remarks

The mail merge functionality allows you to bind the control to an external data source, preview dynamic content in the opened document template, and generate the resulting document with merged data.

Run Demo: Mail Merge

The following code snippet configures the mail merge settings:

razor
@inject NwindDataService NwindDataService
<DxRichEdit>
    <MailMergeSettings>
        <DxMailMergeSettings Data="@DataSource" ViewMergedData="true" ActiveRecord="1"/>
    </MailMergeSettings>
</DxRichEdit>

@code {
    IEnumerable<Employee> DataSource;
    protected override async Task OnInitializedAsync() {
        DataSource = await NwindDataService.GetEmployeesAsync();
        await base.OnInitializedAsync();
    }
}
csharp
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace BlazorDemo.Data.Northwind {
    public partial class Employee {
        public Employee() {
            this.Orders = new List<Order>();
        }
        public int EmployeeId { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string Title { get; set; }
        public string TitleOfCourtesy { get; set; }
        public Nullable BirthDate { get; set; }
        public Nullable HireDate { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public string Region { get; set; }
        public string PostalCode { get; set; }
        public string Country { get; set; }
        public string HomePhone { get; set; }
        public string Extension { get; set; }
        public string Notes { get; set; }
        public Nullable<int> ReportsTo { get; set; }
        public string PhotoPath { get; set; }
        public virtual ICollection<Order> Orders { get; set; }
        public string Text => $"{FirstName} {LastName} ({Title})";
        public string ImageFileName => $"Employees/{EmployeeId}.jpg";
    }
}

Implements

IComponent

IHandleEvent

IHandleAfterRender

IDisposable

Inheritance

Object ComponentBase DevExpress.Blazor.Internal.BranchedRenderComponent DevExpress.Blazor.Internal.ParameterTrackerSettingsComponent DxMailMergeSettings

See Also

DxMailMergeSettings Members

Mail Merge in Blazor Rich Text Editor

DevExpress.Blazor.RichEdit Namespace