I just upgraded the version of the controls I was using from version 7.2.something to 8.2 to fix an issue with the Tree control, and now I'm seeing a new problem in the appearance of a WinGrid.
I need the WinGrid to (a) wrap the contents of its cells and (b) autosize the height of its rows to fit the wrapped text. This was working beautifully before, but with the new version it appears that every row now has a minimum height that corresponds to two rows of text, even when none of the cells in the row wrap to a second line. Of course this looks fine when the text does wrap to a second (or even third) line. It's like it won't autosize down to fit the height of a single line of text.
And it's not a factor of all rows being fixed at the height of two lines of text. I can get one of the cells to wrap to a third line and its row height increases to accommodate this, while all other rows stay at the two-line height.
I have:
DisplayLayout.Override.CellMultiLine = trueDisplayLayout.Override.RowSizing = AutoFixed
I've spent the morning trying all kinds of permutations on other properties that I previously hadn't messed with, like DisplayLayout.Override.DefaultRowHeight (which is now back to its default of -1), DisplayLayout.Override.MinRowHeight (which is now back to its default of -1), and RowSizingAutoMaxLines (which is now back to its default of -1). DefaultRowHeight and MinRowHeight can increase the min height of the row, but won't get it down to the height of a single non-wrapped line of text.
So it seems that something has changed in the calculation of minimum row heights between 7.2 and 8.2.20082.1000, but I can't seem to find out how to fix it experimentally. Can you please help me with this?
Thanks!Jim Honeycutt
PS: Two more things:
(1) I also added some code that goes back through all the rows and calls PerformAutoSize() on each to see if that would help, but it didn't.
(2) I also thought it might've been due to some garbage left in the designer-generated code from the previous version that interfered, so I removed the control from the form and recreated it using the new version. Same results.
Thanks,Jim Honeycutt
Hi Jim,
Are you setting the TextRenderingMode property on the grid? Or maybe the static property of the same name on Infragisitcs.Win.
If you are using GDI (instead of GDI+), then this is a known bug in the grid that was introduced in v8.2 and will be fixed in the next hot fix.
Did you get the latest Hot Fix?
If that doesn't help, you should Submit an incident to Infragistics Developer Support so they can check this out.
Hi Mike,
I need to re-open this one. Per the earlier posts in this thread, changing the Grid's TextRenderingMode from Default to GDI (not GDI+) fixed the double-height row problem for the Grid on the screen.
However, when you do a print preview on the grid (by wiring up an UltraPrintPreviewDialog to an UltraGridPrintDocument to the grid itself), the output in the Print Preview still displays with the double height. It appears to be the same result as I was getting before changing the TextRenderingMode. The same is true of the actual printed output.
I can't find a TextRenderingMode property in the UltraPrintPreviewDialog or UltraGridPrintDocument, so I'm guessing this is a bug in the WinGrid?
Please advise. Also if this is a bug, where would I report that?
Thanks for your help!Jim Honeycutt
That property was set to "Default". I set it to "GDI+" and no change, the problem still occurred.
I then set it to "GDI" and that actually fixed the problem. That's the opposite of what you said, so maybe the bug works opposite on the west coast than it does on the east coast, LOL! :-)
Anyway, it's working fine now. Thanks for the help!
Jim Honeycutt