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,
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.
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.
Hi Mike,
I modified the sample application with your suggestion however I do not see any difference.
I added the following line of code in the InitializeLayout method of the grid:
this.ultraGrid1.TextRenderingMode = TextRenderingMode.GDI;
Can you attach a sample application, preferably the sample I provided you but with the modification, where you see the issue resolved.
Thanks.
You are correct. GDI does not have an impact. In my earlier test, changing the GDI setting caused the designer to reserialize and some settings were lost so it appeared that the issue went away. I have asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 246168. This will be assigned to a developer in a future sprint to review my investigation and confirm my findings or to offer a fix or other resolution.
Please let me know if you need more information.
Hi,
It has been almost year since reporting this issue. Has there been any progress made in resolving it? Can you please provide a status update.
Thanks,
Lindos.
This issue was fixed in 17.2 and up, and we sent you a notification by e-mail in January of 2018. So you just need to get the latest service release.
This service release is available from your My Keys and Downloads Page on the Infragistics Website. To download the service release, select the 'Dev Tools' tab and then select the volume you are using. Finally, select the 'Service Releases' tab and the available service releases will be listed below.