2
Vote

CellSection.Layout doesn't give the right height for singleline columns (WrapText = false) when the data contains newlines

description

When you have a column with WrapText = false and column data which contains newlines (\n) the height is calculated as if the column was MultiLine, so the height of the row is too big.
 
To fix this, change line #34 from
size = gs.Graphics.MeasureString( DisplayItem.ToString(), Font );
to
size = gs.Graphics.MeasureString(DisplayItem.ToString().Replace(Environment.NewLine, " ").Replace("\n", " "), Font);

comments