My question concerns text wrapping in UltraGrid Columns. In previous posts I've seen replies that state the CellMultiLine property will only wrap text in a cell if the cell text contains returns or new lines. It's the CellMultiLine property that drives whether those new line characters will be respected and placed on new lines.
I've been tasked with providing a way to wrap text in a cell without the presence of any new line or return characters. Even without the presence of return characters, it seems like this is a function that could be accomplished.
Since CellMultiLine doesn't appear to be an option, I added a DrawFilter to the grid, trapping on the BeforeDrawForeground phase of all TextUIElement. Then while coding the DrawElement method, I noticed that the TextUIElement has a property "WrapText" on it. Setting that property to true accomplishes most of what I want, cell text is wrapping in columns without the need for return characters.
The remaining problem I have, however, is that the row itself is not autosizing it's height to match the height of the largest cell despite having RowSizing set to "AutoFixed" and "AutoFree" (i've tried both). I've even tried calling .PerformAutoResize() on every row in the grid with no success.
My questions are:
1) If CellMultiLine really is only meant to enable / disable the support of newline characters in cell data, it seems like a true "WrapText" on the column would be a natural since the behavior is already available in the TextUIElement. Am I missing something?
2) Is there a way to amend my approach (using the drawfilter) such that every row's height (not width, that has to be user driven) is automatically resized to the largest cell value?
Thanks in advance.
Chris Rowland
Hi Chris,
puckstopper_37 said:In previous posts I've seen replies that state the CellMultiLine property will only wrap text in a cell if the cell text contains returns or new lines.
Did you try this out? I just tried it and it wraps just fine without any return characters.
Hi Mike. Thanks for the response.
The first thing I tried on this project was setting the CellMultiLine property to true (in fact I set it true everywhere I could find, just to be safe, meaning on the band and each individual column). However that didn't seem to have any affect, my columns with data longer than the cell were still appearing with the elipses but were not multiline.
After searching the forums, I found this thread:
http://community.infragistics.com/forums/p/3789/19585.aspx
Where you replied to a similar topic:
That being said, after your reply this morning I created a new project where I inserted a simple UltraGrid with a few test rows of data, set CellMultiLine to true, and I'm indeed seeing my data automatically wrap without any return characters.
So I guess I should revise my initial question instead to ask: Is there any setting (or anything else) that could potentially override the CellMultiLine property set to true?
Thanks!