Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Ultragrid scrolling is very slow when Columnstyle is set to Formatted Text
posted

I have an UltraGrid which displays data with visual indicators i.e Text with image. I notice that the scrolling is very slow when the column style is set to formatted text. Not all the cells have values, so I tried just setting the cell display style to formatted text and it doesn't render the image. What can be done to prevent slowness while scrolling?

Thanks.

  • 6120
    Offline posted

    Hello Ramya,

    There is a possibility of embedding images to the text of a column by setting its Style to FormattedText. This column should be populated with xml strings that contain embedded image data. For example, you can write a method like this to create an xml string from the image data:


    private static string GetImageTag(Image image)
            {
                return string.Format("<img style=\"width:{0}px; height:{1}px;\" data=\"{2}\"/>",
                    image.Width,
                    image.Height,
                    Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor.EncodeImage(image));
            }

    You can also refer to the attached sample on how to achieve this.

    For observing the performance lag that you mentioned, I followed the steps you suggested and was unable to reproduce the behavior you're describing. I have created a Grid bound to a DataTable with an embedded image data column. The Grid renders the image in this specific column and when I scroll through the Grid I’m not observing any performance lag.

    I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, then the change in behavior is due to differences in your environment from mine and these differences can be anything from operating system version to the specific version of the Infragistics DLL versions used. My test was performed using version 2016.2.20162.1000 in Infragistics for Windows Forms 2016 Vol2. Please provide more details about your machine and version of the assemblies that you are referencing so that I can modify the environment that I am testing in to match yours.

    If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. This can be done by either making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.

    Please let me know if I can provide any further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer

    ColumnStyleImage.zip