I have a grid that has the StationaryMargins set to HeaderAndFooter, a RowHeightDefault of Unit.Pixel(20) and a fixed control height of 300 pixels. I had to set the RowHeightDefault so UltraWebGrid would stop filling all the vertical space regardless of how many rows there were and I had to set a fixed control height so that the StationaryMargins setting would make a difference.
But now whenever I overflow one of my cells, even though I have RowStyleDefault.Wrap set to true, the text doesn't wrap, it just gets cut off. How can I make text wrap play nice with these settings?
Thanks,
Matt
I didn't even think of that, though now that you mention, that would explain it. WebGrid can't wrap something unless there's some kind of spacing character for it to wrap with. Hopefully this will help someone else who encounters similar behavior in the future - thanks for sharing!
nevermind, stupid testing mistake on my part. I was using the string 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' to test to see if it would wrap. Obviously it won't seeing as how there are no line breaks in that string. Writing normal sentences with spaces works just fine, however, so there never really was an issue.
Your cell is probably wrapping, but the row will not automatically increase in height in this scenario.
When you turned on Stationary Margins, this requires you to also set the grid's DisplayLayout.TableLayout property to Fixed. WebGrid no longer auto-sizes when this is set, just like an HTML table. The default value, Auto, essentially tells the browser to treat any column widths and row heights as "suggestions," and most browsers will increase column or row size to fit the contents.
Try increasing the height of the row where you have long text, to ensure that the text is wrapping. Alternately, you can try turning off Stationary Margins and Fixed Headers, then set TableLayout back to Auto, to ensure that the auto-sizing works correctly.