TX Text Control .NET for Windows Forms

InsertMergeBlockDialog Constructor

Constructor|Introduced in 24.0
Namespace
TXTextControl.DocumentServer.Windows.Forms
Package
TXTextControl.TextControl.WinForms.SDK as TXDocumentServer.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Creates a InsertMergeBlockDialog object for the specified DocumentServer.DataSources.DataSourceManager.

Syntax

public InsertMergeBlockDialog(DataSourceManager dataSourceManager, object textControl, DataTableInfo tableInfo);

Parameters

ParameterDescription
dataSourceManager

Specifies the DataSourceManager which manages the current data source.

textControl

A TextControl or a ServerTextControl instance containing the document into which the merge block is inserted.

tableInfo

Specifies the DataTableInfo which represents the table the new merge block is based on.

Examples

The following example loads a small customer data source, selects its master table, and opens the merge-block dialog only when merging is available.

TXTextControl.DocumentServer.DataSources.DataSourceManager dataSourceManager = new();
dataSourceManager.LoadJson("[{\"CustomerName\":\"Contoso Ltd.\"}]");
TXTextControl.DocumentServer.DataSources.DataTableInfo tableInfo = dataSourceManager.MasterDataTableInfo;
using TXTextControl.DocumentServer.Windows.Forms.InsertMergeBlockDialog dialog = new(dataSourceManager, textControl, tableInfo);
if (dataSourceManager.IsMergingPossible)
{
    dialog.ShowDialog();
}