Load images in cell

2 posts, 0 answers
  1. Cristina
    Cristina avatar
    3 posts
    Member since:
    Nov 2018

    Posted 13 Jul Link to this post

    I have configured a radgridview element where we load approximately 1000 records. After loading the Database elements, I need to configure an icon column as shown in the image (IMG01). This icon is not part of the information of the database object but I load it directly to the radgridview column (IMG02). On the first item load this loop takes no more than 1 second for the 1000 items in the table.

    If I make any changes and reload all the information from the database, the next execution of that loop takes about 40 seconds.

    The image code IMG02 always runs after the image code IMG03.

    Is there a way to improve the loading of these images in the radgridview element?

    Thank you!

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 13 Jul Link to this post

    Hello, Cristina,

    I would like to note that each update action over a cell in RadGridView will perform refresh operation of the grid. The more updates you have, the more refresh operations will be performed. This is expected to affect the performance.

    The appropriate solution that I can suggest is to wrap the foreach loop in a BeginUpdate/EndUpdate block. Thus, the refresh operation will be executed only once after calling EndUpdate

                this.radGridView1.BeginUpdate();
                foreach (GridViewRowInfo row in this.radGridView1.Rows)
                {
                    row.Cells[0].Value = "update";
                }
                this.radGridView1.EndUpdate();

    I hope this information helps. If you need any further assistance please don't hesitate to contact me.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

Back to Top