# InsertMergeBlockDialog Constructor

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

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer.WPF > InsertMergeBlockDialog Constructor
- **863 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/insertmergeblockdialog/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/insertmergeblockdialog/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/insertmergeblockdialog/constructor/llms-full.txt

---

### Description

Creates a InsertMergeBlockDialog object for the specified [DocumentServer.DataSources.DataSourceManager](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/llms-full.txt).

### Syntax

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

```vbnet
Public Sub New(dataSourceManager As DataSourceManager, textControl As Object, tableInfo As DataTableInfo)
```

### Parameters

| Parameter | Description |
|---|---|
| dataSourceManager | Specifies the [DataSourceManager](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/llms-full.txt) which manages the current data source. |
| textControl | A [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt) or a [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/llms-full.txt) instance containing the document into which the merge block is inserted. |
| tableInfo | Specifies the [DataTableInfo](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datatableinfo/llms-full.txt) 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.

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

```vbnet
Dim dataSourceManager As New TXTextControl.DocumentServer.DataSources.DataSourceManager()
dataSourceManager.LoadJson("[{""CustomerName"":""Contoso Ltd.""}]")
Dim tableInfo As TXTextControl.DocumentServer.DataSources.DataTableInfo = dataSourceManager.MasterDataTableInfo
Dim dialog As New TXTextControl.DocumentServer.WPF.InsertMergeBlockDialog(dataSourceManager, textControl, tableInfo)
If dataSourceManager.IsMergingPossible Then dialog.ShowDialog()
```

---

## Nearby

- **Previous:** [InsertMergeBlockDialog.BlockType Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/insertmergeblockdialog/blocktype-property/llms-full.txt)
- **Next:** [InsertMergeBlockDialog.CreatedTable Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/insertmergeblockdialog/createdtable-property/llms-full.txt)
