Merge blocks can be filtered and sorted with linked instructions that help to shape the used data in each merge block. This article shows how to add sorting and filter instructions to existing merge blocks. These instructions can be added using the out-of-the-box dialog boxes. Consider the following merge block: Using the Dialog A dialog box can be used to add filters and sorting instructions: After a filter has been added using the dialog, only data rows with a LineTotal value larger than 1000 are visible: Apply Instructions Programmatically In order to apply these instructions programmatically, the MergeBlockInfo class can be utilized. The following code uses the SubTextPart at the current input position to create an instance of the MergeBlockInfo. After that, a new filter is added to the list of FilterInstructions. Additionally, a sorting instruction is added to the SortingInstructions property. // check if there is a SubTextPart at the // current input position if (textControl1.SubTextParts.GetItem() == null) return; // retrieve current SubTextPart SubTextPart stpMergeBlock = textControl1.SubTextParts.GetItem(); // check if SubTextPart is a MergeBlock if (TXTextControl.DocumentServer.DataSources.DataSourceManager.IsMergeBlock( textControl1.SubTextParts.GetItem()) == true) { // create a MergeBlockInfo object from SubTextPart TXTextControl.DocumentServer.DataSources.MergeBlockInfo mbInfo = new TXTextControl.DocumentServer.DataSources.MergeBlockInfo(stpMergeBlock); // add a filter mbInfo.Filters.Add( new TXTextControl.DocumentServer.DataShaping.FilterInstruction( "Price", TXTextControl.DocumentServer.DataShaping.RelationalOperator.GreaterThan, 500)); mbInfo.SortingInstructions.Add( new TXTextControl.DocumentServer.DataShaping.SortingInstruction( "Price", TXTextControl.DocumentServer.DataShaping.SortOrder.Ascending)); // important: apply the settings mbInfo.Apply(); At the end, it is very important to call the Apply method that stores the meta data (filters, sorting instructions and the block merging condition) in the SubTextPart which represents the merge block.