Hi we upgraded infragistics from 13.1 to 15.2, our client found out performance degraded when scrolling UltraGird with 1000+ rows. The more data shown in a row, the slower it is when dragging scroll bar down the page.
one of the column style is FormattedTextEditor.
We'd like to know if there is any change from 13.1 to 15.2 that affected the performance on scrolling UltraGrid.
Thanks,
Crystal,
Hi Lindos,
Just to be sure I understand, in the code you posted here, ImageX is a string that contains the encoded version of the image for the XML? So that means that the performance issue is occuring when the FormattedTextEditor is parsing the encoded image. Hm, I can't imagine how THAT would have changed. My guess is that it didn't, and it just always been more efficient to use a file instead of a string. But it's great that you found it.
To answer your question - no, you can't use an src tag and point to an embedded resource. Although I guess in theory, you could store the image in your application as an embedded resource, then load that image into memory and then save it to a file, rather than distributing it separately with the application. You could dump it into the same folder as the exe or maybe into the machines Temp folder. Not ideal, but probably not terrible, depending on the size of your images.
We're coming up on the release for 19.2, so I'm a bit swamped at the moment. If you can send me a sample, I'd still love to check it out. But if I can find some time, I will try to do a little testing myself using images with a data tag.
Hi Mike,
While I was migrating our production code over to the sample application, I came upon the code where we build the HTML for the FormattedTextEditor. We keep our images as embedded resources in the project and use the following syntax for embedding the image in the cell:
var encodedImg = FormattedLinkEditor.EncodeImage(Properties.Resources.ImageX); var html = $"<img data="{encodedImg}" />"; ultraDataRow["Column1"] = html;
I recalled that there is an alternate way of adding images to the cell by using the src tag, with a file path to the image, and tested the following in the production code:
var html = @"<img src=""C:\Test\Imagex.png""/>";; ultraDataRow["Column1"] = html;
The performance issue immediately went away using the src tag. It seemed to even be more performant than the "fixed" 2118 SR version using the data tag. It looks like the issue is in rendering the image using the data tag. The images being loaded are all 16x16 32 bit png around 660 bytes, nothing huge.
I have implemented a work around for the performance issue in the production code by using the src tag and putting all the images in a folder on disk instead of embedding them as a resource. While this isn't a perfect solution, I believe it will work as a patch to our code for our customers as this will have minimal impact on regression testing.
Is there any way of loading the images from embedded resources and using them with the src tag instead of loading them from disk? This would remove the dependency of having the images deployed to disk and read from there. Do you see anything out of the ordinary with how we're using the data tag with an encoded embedded resource?
If you have any other suggestions, that would be greatly appreciated.
Lindos.
Well, since 2118 is the only service release for 15.2, there aren't a lot of options. There's no real middle ground here.
The best we could hope for is that if you are able to reproduce the issue in a sample, and I can track down exactly what change fixed it (which I am pretty sure I can), then it's possible that I could find a workaround that you could implement in your code and you would not need to update your Infragistics assemblies at all - you could just fix it in your own code and that would be the most limited possible change.
Of course, it's also possible that there is no way to work around the issue in your code - that the problem is buried deep in the control and there's no way you can get around it. In which case, the best option for you would be to update to 2118.
Thanks for looking further into this issue and for answering my questions about the version compatibility.
I will continue to attempt to try and reproduce the issue in a sample app.
If I can get the sample app to show the issue, and you are able to track down the cause to a bug in 2052 that was fixed with 2118, what would be your recommended next steps in getting this fixed in our production code? Do you provide small patches/hot fixes for such occasions? Or, would we ultimately need to do a full upgrade to 2118?
Oh... I just checked and apparently 2118 was the only Service release for v15.2.
Also, to answer your question, all of the versions are always backward compatible (aside from the occasion breaking change that has to be made for a bug fix).
But you can't mix versions. All of the Infragistics assemblies need to be the same version.