The following code snippet is from the FieldLayoutInitialized handler of a XamDataGrid. Setting the CellWidth to 250 works fine (case "abc"), but setting it to 20 doesn't (case "def"), even if I am setting the CellMinWidth to the same value. It looks like the minimum width I can can set it to is around 60 (for this particular grid). Is there any other setting that prevents the CellWidth to go below a certain value?
foreach (var field in e.FieldLayout.Fields)
{
switch (field.Name.ToLower())
case "abc":
field.Settings.CellWidth = 250;
break;
default:
field.Settings.CellMinWidth = 20;
field.Settings.CellWidth = 20;
}
Answering my own question: It's the LabelWidth that was preventing the CellWidth to go below a certain value. Problem resolved by setting LabelWidth = CellWidth.