Hi
Does anyone have any problems with the 'ResizeToFit' function. I have a code snippet from the onclick event that changes the orientation of the text in the header.
I initially draw the grid with the header text at an orientation of 270.
My problem is that on Orientating the text to 0 the resize is inconsistent and the column width is resized to different sizes with single words being wrapped over 2 or 3 lines?
i.e.
Adve
rse
Eve
nts
rather than Adverse Events
(see attachment).
if (row == 0)
{
// then is a column header
// change orientation of text
// either 0 (horizontal) or 270 (vertical)
// turn off read-only (temporarily)
syncGrid.IgnoreReadOnly = true;
syncGrid[row, col].Font.Orientation = ((syncGrid[row, col].Font.Orientation % 180) == 0) ? 270 : 0;
syncGrid.IgnoreReadOnly = false;
// resize column
syncGrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Col(col),GridResizeToFitOptions.IncludeHeaders);
}
Can anyone let me know what I'm doing wrong?
Best Regards,
David
Header---resize.zip