I have an UltraGrid which has columns configured with a style of FormattedTextEditor. The DisplayLayout is also configured with RowSizing = AutoFree and CellMultiLine = True.
An image is embedded in the text using the img tag.
Example:
row.Cells[0].Value = "Some Text here <img data= \"{FormattedLinkEditor.EncodeImage("Icon1")}\" Align =\"bottom\" /> more text here."
If the grid column is not wide enough to display the full text and image on a single line it will wrap the text and image to the next line. The wrapping does not work correctly when the image is the last item on that line. In the above example "more text here" is wrapped to the next line, then the image is overlaid on the current line. The image will wrap to the start of the current line overlaying the text in that line. The overlaying will sometimes occur immediately when the grid is rendered, or the column is resized, and will always occur when the cell has mouse over.
Please review the attached sample project, which reproduces the issue, and suggest any resolutions to this issue.
Hi Lindos,
After some testing, I have found that the issue does not occur if you set the grid's TextRenderingMode property to GDI rather than GDI+.
The reason this happens is because GDI+ was designed to trade some accuracy for better performance. This means that some controls which render multiple spans of text will have measuring errors in GDI+. For these cases, I recommend using the slower, but more accurate GDI rendering mode.
Please try setting the TextRenderingMode and let me know whether it works.
Thank you for sending your sample application. I am able to reproduce this issue and I am now working to isolate it so that I can provide you with an explanation for the behavior and a solution for you.
Please let me know if you have any questions.