Back to Devexpress

MailMergeOptions.DataSource Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-mailmergeoptions-37a1665d.md

latest4.8 KB
Original Source

MailMergeOptions.DataSource Property

Gets or sets the data source for the mail merge.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
object DataSource { get; set; }
vb
Property DataSource As Object

Property Value

TypeDescription
Object

An object that represents the data source from which the merged data is retrieved.

|

Remarks

The following data sources are supported:

  • System.Collections.IList
  • System.Collections.ArrayList
  • System.Data.DataTable

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-use-multiple-data-sources-for-mail-merge/CS/MailMergeSample/Default.aspx.cs#L45

csharp
mailMergeOptions.DataSource = invoices;
}

word-document-api-create-master-detail-report/CS/Program.cs#L48

csharp
// Assign the data source (customers collection). Null-propagation prevents exceptions if deserialization failed.
myMergeOptions.DataSource = nwind?.Customers;

winforms-richedit-control-mail-merge/CS/MailMerge/Form1.cs#L38

csharp
MailMergeOptions myMergeOptions = richEditControl1.Document.CreateMailMergeOptions();
myMergeOptions.DataSource = new SampleData();
myMergeOptions.FirstRecordIndex = 1;

word-document-api-use-docvariable-fields/CS/Program.cs#L30

csharp
myMergeOptions.MergeMode = MergeMode.NewSection;
myMergeOptions.DataSource = new SampleData();

office-file-api-in-web-api-app/CS/Controllers/RichEditController.cs#L160

csharp
MailMergeOptions myMergeOptions = wordProcessor.Document.CreateMailMergeOptions();
myMergeOptions.DataSource = RichEditHelper.FillDataTable();
myMergeOptions.MergeMode = mergeMode;

word-document-api-use-multiple-data-sources-for-mail-merge/VB/MailMergeSample/Default.aspx.vb#L39

vb
invoices.Add(New Invoice(2, "Invoice3", 20.0D))
    mailMergeOptions.DataSource = invoices
ElseIf Equals(templateName, "preview2") Then

winforms-richedit-control-mail-merge/VB/MailMerge/Form1.vb#L35

vb
Dim myMergeOptions As MailMergeOptions = richEditControl1.Document.CreateMailMergeOptions()
myMergeOptions.DataSource = New SampleData()
myMergeOptions.FirstRecordIndex = 1

word-document-api-use-docvariable-fields/VB/Program.vb#L24

vb
myMergeOptions.MergeMode = MergeMode.NewSection
myMergeOptions.DataSource = New SampleData()

See Also

MailMergeOptions Interface

MailMergeOptions Members

DevExpress.XtraRichEdit.API.Native Namespace