We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ResizeToFit problem

Hi, I have a problem resizing header cells in a grid. I am using the new version 1.6.1.0 and I realized that the method ResizeToFit(xxx) now is working. But here's what's happening or better what's not happening: I want the following: I have a grid with a header row and in each cell there's a text oriented by 90 degrees. Because of the length of the text I want it to be wrapped in the cells and after that the row width should be resized to fit the contents (the wrapped text!). I played around a lot with the following, but nothing worked fine (ResizeToFit, WrapText, Trimming, AutoSize). I realized that the ResizeToFit method ignores the wrapText property and the autosize property doesn't affect anything. Is there a way to get it done - to auto resize wrapped cell content? Any help I appreciate Michael

1 Reply

AD Administrator Syncfusion Team June 24, 2003 12:48 PM UTC

It is not perfect, but if you insert \r (ie. Environment.NewLine) to hard break your text where you want the breaks, then calling this.gridControl1.RowHeights.ResizeToFit(...) this.gridControl1.ColWidths.ResizeToFit(...) back to back will size both the row height and colwidth to fit the text with the hard breaks.

Loader.
Live Chat Icon For mobile
Up arrow icon