officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-mailmergeoptions-37a1665d.md
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
object DataSource { get; set; }
Property DataSource As Object
| Type | Description |
|---|---|
| Object |
An object that represents the data source from which the merged data is retrieved.
|
The following data sources are supported:
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
mailMergeOptions.DataSource = invoices;
}
word-document-api-create-master-detail-report/CS/Program.cs#L48
// 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
MailMergeOptions myMergeOptions = richEditControl1.Document.CreateMailMergeOptions();
myMergeOptions.DataSource = new SampleData();
myMergeOptions.FirstRecordIndex = 1;
word-document-api-use-docvariable-fields/CS/Program.cs#L30
myMergeOptions.MergeMode = MergeMode.NewSection;
myMergeOptions.DataSource = new SampleData();
office-file-api-in-web-api-app/CS/Controllers/RichEditController.cs#L160
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
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
Dim myMergeOptions As MailMergeOptions = richEditControl1.Document.CreateMailMergeOptions()
myMergeOptions.DataSource = New SampleData()
myMergeOptions.FirstRecordIndex = 1
word-document-api-use-docvariable-fields/VB/Program.vb#L24
myMergeOptions.MergeMode = MergeMode.NewSection
myMergeOptions.DataSource = New SampleData()
See Also