# InsertMergeBlockDialog Class

> The InsertMergeBlockDialog class allows the user to design and insert a merge block based on the currently selected master table. It is inserted at the current input position of a given Text Control instance. The InsertMergeBlockDialog is a modal dialog box which must be shown with the InsertMergeBlockDialog.ShowDialog method.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.Windows.Forms`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.Windows.Forms.dll` from the setup
- **Inherits:** `System.Windows.Forms.Form` › `TXTextControl.DocumentServer.Windows.Forms.HighDpiForm`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.Windows.Forms > InsertMergeBlockDialog Class
- **1260 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/llms-full.txt

---

### Description

The InsertMergeBlockDialog class allows the user to design and insert a merge block based on the currently selected master table. It is inserted at the current input position of a given Text Control instance. The InsertMergeBlockDialog is a modal dialog box which must be shown with the `InsertMergeBlockDialog.ShowDialog` method.

### Syntax

```csharp
public class InsertMergeBlockDialog : HighDpiForm
```

```vbnet
Public Class InsertMergeBlockDialog
    Inherits HighDpiForm
```

### 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;
using TXTextControl.DocumentServer.Windows.Forms.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
Using dialog As New TXTextControl.DocumentServer.Windows.Forms.InsertMergeBlockDialog(dataSourceManager, textControl, tableInfo)
    If dataSourceManager.IsMergingPossible Then dialog.ShowDialog()
End Using
```

---

## In This Section

- [InsertMergeBlockDialog.AddResult Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/addresult-property/llms-full.txt): Returns whether the new block has successfully been inserted.
- [InsertMergeBlockDialog.AddTableHeaderRow Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/addtableheaderrow-property/llms-full.txt): Indicates whether a separate header row has to be added to the table containing the repeating merge block. In case of a paragraph based merge block the value of this property can be ignored.
- [InsertMergeBlockDialog.BlockType Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/blocktype-property/llms-full.txt): Indicates the type of the merge block to be created.
- [InsertMergeBlockDialog Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/constructor/llms-full.txt): Creates a InsertMergeBlockDialog object for the specified DocumentServer.DataSources.DataSourceManager.
- [InsertMergeBlockDialog.CreatedTable Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/createdtable-property/llms-full.txt): Returns the newly created TXTextControl.Table if the merge block was inserted as a table row.
- [InsertMergeBlockDialog.HighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/highlightcolor-property/llms-full.txt): Returns the selected highlight color to be used for the sub text part representing the merge block.
- [InsertMergeBlockDialog.MergeBlockInfo Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/mergeblockinfo-property/llms-full.txt): Returns a MergeBlockInfo object describing the merge block to be inserted.

---

## Nearby

- **Previous:** [FilterAndSortDialog.StoreBlockMetaData Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/filterandsortdialog/storeblockmetadata-method/llms-full.txt)
- **Next:** [InsertMergeBlockDialog.AddResult Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-windows-forms/insertmergeblockdialog/addresult-property/llms-full.txt)
