Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 9, 2024 20:01
Show Gist options
  • Save bjoerntx/b951a6f14d47e8da9ba489463434b3e5 to your computer and use it in GitHub Desktop.
Save bjoerntx/b951a6f14d47e8da9ba489463434b3e5 to your computer and use it in GitHub Desktop.
private Table AddMergeBlock(string tableName, DataSourceManager dataSourceManager)
{
// get the columns of the data table
var columns = dataSourceManager.DataTables[tableName].Columns;
// list of column names
var columnNames = columns.Select(c => c.ColumnName).ToList();
// create a new merge block info
MergeBlockInfo mergeBlockInfo = new MergeBlockInfo(tableName)
{
ColumnNames = columnNames
};
// create a new merge block settings
MergeBlockSettings mergeBlockSettings = new MergeBlockSettings()
{
BlockTemplateType = BlockTemplateType.TableRow,
CreateHeaderRow = true
};
// insert the merge block
dataSourceManager.InsertMergeBlock(textControl1, mergeBlockInfo, mergeBlockSettings);
return mergeBlockSettings.CreatedTable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment