Skip to content

Instantly share code, notes, and snippets.

View bjoerntx's full-sized avatar
👨‍💻
Building web apps

Bjoern Meyer bjoerntx

👨‍💻
Building web apps
View GitHub Profile
<system.web>
<httpRuntime targetFramework="4.8" maxRequestLength="1048576" executionTimeout="120" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4294967295" />
</requestFiltering>
</security>
</system.webServer>
builder.Services.Configure<KestrelServerOptions>(options =>
{
options.Limits.MaxRequestBodySize = int.MaxValue;
});
public void ApplyTableStyle(Table table, TableStyle tableStyle)
{
// loop through rows and check for header row
foreach (TableRow row in table.Rows)
{
if (row.IsHeader)
{
row.CellFormat = tableStyle.HeaderRowFormat;
}
else
public void ClearTableStyle(Table table, TextControl textControl)
{
var cellFormat = new TXTextControl.TableCellFormat();
// clear all row formats
foreach (TableRow row in table.Rows)
{
// apply each property of cellFormat to the row by using reflection
foreach (var property in cellFormat.GetType().GetProperties())
{
public class TableStyle
{
public TXTextControl.TableCellFormat TableRowFormat { get; set; }
public TXTextControl.TableCellFormat HeaderRowFormat { get; set; }
}
// load JSON data
var jsonData = File.ReadAllText("JsonModel.json");
// create a new DataSourceManager
DataSourceManager dataSourceManager1 = new DataSourceManager();
dataSourceManager1.LoadJson(jsonData);
var table = AddMergeBlock("mergeBlock1", dataSourceManager1);
TableStyle tableStyle = new TableStyle()
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)
[
{
"name": "Model 1",
"mergeBlock1": [
{
"blockvalue_1": "Block Value 1",
"blockvalue_2": "123"
},
{
"blockvalue_1": "Block Value 2",
[
{
"name": "Model 1",
"mergeBlock1": [
{
"blockvalue_1": "Block Value 1",
"blockvalue_2": "123"
},
{
"blockvalue_1": "Block Value 2",