Hello,
I want to apply widths to certain columns, that are defined by a user. Since the columns themselves don't provide a Width-property, I tried to use the column settings of the MasterTableView.
I create the ColumnSettings like this:
string[] columnWidths = {"125", "164", "64", "125"};
foreach (string columnWidth in columnWidths)
{
Grid.MasterTableView.ColumnSettings.Add(new GridTableView.PersistableColumnSetting
{
Width = columnWidth
});
}
But I can't find any method to apply these settings to a grid column.
Do I miss something or is there an easier way to set the width of a column?
That is correct. The HeaderStyle-Width defines the width of <col > elements in the rendered table. Those dictate the column's (td) width. Also, be sure to use the correct TableLayout (MasterTable-TableLayout) as this dictates how the overall layout of the Table should be displayed regardless of the Column width. For more details you can check out this CSS Tricks article: table-layout - CSS Tricks